diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-12 11:05:38 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-12 11:05:38 +0100 |
| commit | 9bb0b7bab5e7d2bc441e65250c35f34e7975583f (patch) | |
| tree | 586ab510cd0c82b059546b10c3cbd9a812e7ec9f /ansible | |
| parent | 0b0ce5e0a3a95e3a902f193b344a3891d255a93e (diff) | |
mox service waits for global ipv6
Diffstat (limited to 'ansible')
| -rw-r--r-- | ansible/roles/mox/tasks/main.yml | 2 | ||||
| -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() |
