summaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/mox/tasks/main.yml2
-rw-r--r--ansible/roles/mox/templates/openrc/mox (renamed from ansible/roles/mox/files/openrc/mox)21
2 files changed, 21 insertions, 2 deletions
diff --git a/ansible/roles/mox/tasks/main.yml b/ansible/roles/mox/tasks/main.yml
index 7e1f6b9..72ed7c3 100644
--- a/ansible/roles/mox/tasks/main.yml
+++ b/ansible/roles/mox/tasks/main.yml
@@ -134,7 +134,7 @@
- name: Install mox service
register: mox_service
- ansible.builtin.copy:
+ ansible.builtin.template:
src: openrc/mox
dest: /etc/init.d/mox
mode: "755"
diff --git a/ansible/roles/mox/files/openrc/mox b/ansible/roles/mox/templates/openrc/mox
index e5fc838..e04d96a 100644
--- a/ansible/roles/mox/files/openrc/mox
+++ b/ansible/roles/mox/templates/openrc/mox
@@ -21,7 +21,26 @@ configtest()
depend()
{
- need unbound
+ need net unbound
+}
+
+start_pre() {
+ ebegin "Waiting for global IPv6 address {{ ansible_facts.default_ipv6.address }} to be ready"
+
+ local i=0
+ while [ "$i" -lt 30 ]; do
+ if ip -6 addr show scope global | grep -q "{{ ansible_facts.default_ipv6.address }}" && \
+ ! ip -6 addr show scope global | grep -q "{{ ansible_facts.default_ipv6.address }}.*\btentative\b"
+ then
+ eend 0
+ return 0
+ fi
+ sleep 2
+ i=$((i + 2))
+ done
+
+ eend 1 "Global IPv6 address {{ ansible_facts.default_ipv6.address }} not ready after 30 seconds"
+ return 1
}
start()