ansible/roles/network/tasks/dns-file.yml

42 lines
1.1 KiB
YAML

---
- name: create dns directory
file:
path: /srv/bind/config
state: directory
- name: Create db lan
template:
src: etc/bind/db.lan.j2
dest: /srv/bind/config/db.lan
vars:
network: "{{ lan }}"
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
- name: Create reverse db lan
template:
src: etc/bind/db.reverse.j2
dest: /srv/bind/config/db.{{ lan.network_reverse }}
vars:
network: "{{ lan }}"
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
- name: Create db iot
template:
src: etc/bind/db.lan.j2
dest: /srv/bind/config/db.iot
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
dest: /srv/bind/config/db.{{ iot.network_reverse }}
vars:
network: "{{ iot }}"
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
- name: restart container
shell:
cmd: docker service update --force --detach bind