2020-11-29 00:12:15 +00:00
|
|
|
---
|
2023-05-11 20:37:41 +00:00
|
|
|
- name: create dns directory
|
2020-11-29 00:12:15 +00:00
|
|
|
file:
|
2023-05-11 20:37:41 +00:00
|
|
|
path: /srv/bind/config
|
2020-11-29 00:12:15 +00:00
|
|
|
state: directory
|
|
|
|
|
2022-08-01 21:55:16 +00:00
|
|
|
- name: Create db lan
|
2020-11-29 00:12:15 +00:00
|
|
|
template:
|
|
|
|
src: etc/bind/db.lan.j2
|
2023-05-11 20:37:41 +00:00
|
|
|
dest: /srv/bind/config/db.lan
|
2020-11-29 00:12:15 +00:00
|
|
|
vars:
|
|
|
|
network: "{{ lan }}"
|
|
|
|
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
2021-02-23 18:37:52 +00:00
|
|
|
|
2022-08-01 21:55:16 +00:00
|
|
|
- name: Create reverse db lan
|
2021-02-23 18:37:52 +00:00
|
|
|
template:
|
|
|
|
src: etc/bind/db.reverse.j2
|
2023-05-11 20:37:41 +00:00
|
|
|
dest: /srv/bind/config/db.{{ lan.network_reverse }}
|
2021-02-23 18:37:52 +00:00
|
|
|
vars:
|
|
|
|
network: "{{ lan }}"
|
|
|
|
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
2022-08-01 21:55:16 +00:00
|
|
|
|
|
|
|
- name: Create db iot
|
|
|
|
template:
|
|
|
|
src: etc/bind/db.lan.j2
|
2023-05-11 20:37:41 +00:00
|
|
|
dest: /srv/bind/config/db.iot
|
2022-08-01 21:55:16 +00:00
|
|
|
vars:
|
|
|
|
network: "{{ iot }}"
|
|
|
|
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
|
|
|
|
|
|
|
- name: Create reverse db iot
|
|
|
|
template:
|
|
|
|
src: etc/bind/db.reverse.j2
|
2023-05-11 20:37:41 +00:00
|
|
|
dest: /srv/bind/config/db.{{ iot.network_reverse }}
|
2022-08-01 21:55:16 +00:00
|
|
|
vars:
|
|
|
|
network: "{{ iot }}"
|
|
|
|
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
2023-05-11 20:37:41 +00:00
|
|
|
|
|
|
|
- name: restart container
|
|
|
|
shell:
|
|
|
|
cmd: docker service update --force --detach bind
|