summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xansible/all.sh81
-rw-r--r--ansible/atuin.liw.fi.yml4
-rw-r--r--ansible/exolobe1.yml2
-rw-r--r--ansible/exolobe2.yml2
-rw-r--r--ansible/exolobe4.yml2
-rw-r--r--ansible/git.liw.fi.yml2
-rw-r--r--ansible/holywood2.yml2
-rw-r--r--ansible/irc.liw.fi.yml2
-rw-r--r--ansible/letest-letest.vm.liw.fi.yml2
-rw-r--r--ansible/shell-shell.vm.liw.fi.yml2
10 files changed, 63 insertions, 38 deletions
diff --git a/ansible/all.sh b/ansible/all.sh
index 235b039..af57e61 100755
--- a/ansible/all.sh
+++ b/ansible/all.sh
@@ -2,37 +2,62 @@
set -eu
-playbooks="
+skipped="
holywood2.yml
+debmirror.yml
+"
+
+playbooks="
exolobe1.yml
exolobe2.yml
atuin.yml
"
-# debmirror.yml
-
-for playbook in $playbooks
-do
- echo "$playbook"
- chronic ./run-playbook "$playbook"
-done
-
-if ping -c1 exolobe4 > /dev/null
-then
- echo exolobe4.yaml
- chronic ./run-playbook exolobe4.yml
-fi
-
-echo git.liw.fi
-chronic run-ansible git.liw.fi.hz hosts.git git.liw.fi.yml
-
-echo http.liw.fi
-chronic run-ansible http.liw.fi.hz hosts.http http.liw.fi.yml
-
-echo irc.liw.fi
-chronic run-ansible irc.liw.fi.hz hosts.irc irc.liw.fi.yml
-
-echo shell.liw.fi
-chronic run-ansible shell.liw.fi.hz hosts.shell shell.liw.fi.yml
-echo letest-letest.vm.liw.fi
-chronic run-ansible letest.hz hosts.letest letest.yml
+newer()
+{
+ [ "$1" -nt "$2" ] || [ ! -e "$2" ]
+}
+
+
+online()
+{
+ ping -c1 "$1" > /dev/null 2>/dev/null
+}
+
+maybe_run_playbook()
+{
+ if newer "$1.yml" "$1.stamp" && online "$1"
+ then
+ echo "$1"
+ chronic ./run-playbook "$1.yml"
+ touch "$1.stamp"
+ else
+ echo "SKIPPING $1"
+ fi
+}
+
+maybe_run_ansible()
+{
+ if newer "$1.yml" "$1.stamp" && online "$1"
+ then
+ echo "$1"
+ chronic run-ansible "$1.hz" "hosts.$2" "$1.yml"
+ touch "$1.stamp"
+ else
+ echo "SKIPPING $1"
+ fi
+}
+
+maybe_run_playbook exolobe1
+maybe_run_playbook exolobe2
+maybe_run_playbook exolobe4
+maybe_run_playbook exolobe5
+maybe_run_playbook holywood2
+maybe_run_playbook debmirror
+maybe_run_playbook atuin.liw.fi
+
+maybe_run_ansible git.liw.fi git
+maybe_run_ansible http.liw.fi http
+maybe_run_ansible irc.liw.fi irc
+maybe_run_ansible shell-shell.vm.liw.fi shell
+maybe_run_ansible letest-letest.vm.liw.fi letest
diff --git a/ansible/atuin.liw.fi.yml b/ansible/atuin.liw.fi.yml
index 43b8907..763958a 100644
--- a/ansible/atuin.liw.fi.yml
+++ b/ansible/atuin.liw.fi.yml
@@ -42,7 +42,7 @@
group: liw
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
ansible_python_interpreter: /usr/bin/python3
hostname: atuin
@@ -130,7 +130,7 @@
- liw-holywood
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
ansible_python_interpreter: /usr/bin/python3
hostname: nalanda
diff --git a/ansible/exolobe1.yml b/ansible/exolobe1.yml
index c55b9bd..e780bd8 100644
--- a/ansible/exolobe1.yml
+++ b/ansible/exolobe1.yml
@@ -32,7 +32,7 @@
- riot-host
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: exolobe1
debian_codename: buster
diff --git a/ansible/exolobe2.yml b/ansible/exolobe2.yml
index 7c3a128..faa498c 100644
--- a/ansible/exolobe2.yml
+++ b/ansible/exolobe2.yml
@@ -12,7 +12,7 @@
- smarthost-client
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: exolobe2
debian_codename: buster
diff --git a/ansible/exolobe4.yml b/ansible/exolobe4.yml
index eb7b841..50a12be 100644
--- a/ansible/exolobe4.yml
+++ b/ansible/exolobe4.yml
@@ -23,7 +23,7 @@
- rust-dev-env
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: exolobe4
debian_codename: buster
diff --git a/ansible/git.liw.fi.yml b/ansible/git.liw.fi.yml
index d671975..8ba397c 100644
--- a/ansible/git.liw.fi.yml
+++ b/ansible/git.liw.fi.yml
@@ -12,7 +12,7 @@
- role: self-updating-system
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: git
debian_codename: buster
diff --git a/ansible/holywood2.yml b/ansible/holywood2.yml
index 515ad1b..d6908af 100644
--- a/ansible/holywood2.yml
+++ b/ansible/holywood2.yml
@@ -11,7 +11,7 @@
- self-updating-system
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: holywood2
debian_codename: buster
diff --git a/ansible/irc.liw.fi.yml b/ansible/irc.liw.fi.yml
index 5282c66..db580da 100644
--- a/ansible/irc.liw.fi.yml
+++ b/ansible/irc.liw.fi.yml
@@ -8,7 +8,7 @@
- role: irc-client
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: irc
debian_codename: buster
diff --git a/ansible/letest-letest.vm.liw.fi.yml b/ansible/letest-letest.vm.liw.fi.yml
index 8f11142..67e2ef8 100644
--- a/ansible/letest-letest.vm.liw.fi.yml
+++ b/ansible/letest-letest.vm.liw.fi.yml
@@ -7,7 +7,7 @@
- letest
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: letest
debian_codename: buster
diff --git a/ansible/shell-shell.vm.liw.fi.yml b/ansible/shell-shell.vm.liw.fi.yml
index 5869b62..5cccb46 100644
--- a/ansible/shell-shell.vm.liw.fi.yml
+++ b/ansible/shell-shell.vm.liw.fi.yml
@@ -11,7 +11,7 @@
- role: self-updating-system
vars:
sane_debian_system_version: 0
- unix_users_version: 0
+ unix_users_version: 1
hostname: shell