Add systemd service for internal_named. Try internal_named container restart if DNS test is KO.

This commit is contained in:
yohan 2024-10-06 23:46:04 +02:00
parent 9648366e8b
commit ae615b630a

View File

@ -60,8 +60,34 @@
- /usr/local/docker-mounted-files/docker-internal_named/named.conf.options:/etc/bind/named.conf.options:z
- /usr/local/docker-mounted-files/docker-internal_named/named.conf.local:/etc/bind/named.conf.local:z
- /mnt/volumes/var_cache_internal_named/data:/var/cache/bind:z
state: present
generate_systemd:
path: /etc/systemd/system
become: true
- name: start/enable container service
ansible.builtin.systemd:
daemon-reload: true
name: internal_named
state: started
enabled: true
become: true
- block:
- name: check DNS
command: host scimetis.net 127.0.0.1
changed_when: false
register: check_dns
until: "check_dns is not failed"
retries: 10
delay: 10
rescue:
- name: restart internal_named
ansible.builtin.service:
name: internal_named
state: restarted
become: true
- name: check DNS
command: host scimetis.net 127.0.0.1
changed_when: false