ansible/playbooks/dna-gw.yml
Timo Makinen 4ab9af9d08 Run handlers before configuring unbound on dna-gw hosts
Unbound doesn't automatically bind to CARP interfaces but network is not
restarted at this stage so force running all handlers.
2021-04-28 14:34:33 +00:00

51 lines
1.1 KiB
YAML

---
- import_playbook: "include/deploy-kvm-guest.yml myhosts=dnagw"
- name: configure instance
hosts: dnagw
user: root
gather_facts: true
vars_files:
- "{{ ansible_private }}/vars.yml"
roles:
- base
- ifstated
- dhcpd
- tftp
tasks:
- name: use configured dns servers and domain name
copy:
dest: /etc/dhclient.conf
content: "ignore domain-name-servers, domain-name;"
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
- name: enable ip forwarding
sysctl:
name: "{{ item }}"
sysctl_set: true
value: "1"
with_items:
- net.inet.ip.forwarding
- net.inet6.ip6.forwarding
- name: run handlers to get interfaces configured
meta: flush_handlers
- name: copy dns zone files
copy:
dest: "/var/unbound/db/{{ item }}"
src: "/srv/dns/{{ item }}"
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
notify: restart unbound
with_items:
- 20.172.in-addr.arpa
- home.foo.sh
- import_role:
name: unbound