add become

This commit is contained in:
Hannaeko 2021-07-25 17:35:08 +02:00
parent 070a12cb39
commit 507bb16188
3 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,5 @@
[primary]
163.172.129.205 ansible_user=root
dev-ns1.vm ansible_user=roger
[secondary]
51.158.108.60 ansible_user=root
dev-ns2.vm ansible_user=roger

View file

@ -1,4 +1,5 @@
---
- name: reload knot
become: yes
command:
cmd: knotc reload

View file

@ -1,11 +1,14 @@
---
- name: Install knot
become: yes
apt:
update_cache: yes
pkg:
- knot
- knot-dnsutils
- name: Update zones
become: yes
ansible.builtin.copy:
src: '{{ zones_dir }}/'
dest: /var/lib/knot/zones
@ -15,13 +18,15 @@
notify: reload knot
when: "inventory_hostname in groups.primary"
- name:
- name: Deploy conf
become: yes
template:
src: knot.conf.j2
dest: /etc/knot/knot.conf
notify: reload knot
- name: Start knot
become: yes
service:
name: knot
state: started