add become
This commit is contained in:
parent
070a12cb39
commit
507bb16188
3 changed files with 9 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
[primary]
|
[primary]
|
||||||
163.172.129.205 ansible_user=root
|
dev-ns1.vm ansible_user=roger
|
||||||
|
|
||||||
[secondary]
|
[secondary]
|
||||||
51.158.108.60 ansible_user=root
|
dev-ns2.vm ansible_user=roger
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: reload knot
|
- name: reload knot
|
||||||
|
become: yes
|
||||||
command:
|
command:
|
||||||
cmd: knotc reload
|
cmd: knotc reload
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
---
|
---
|
||||||
- name: Install knot
|
- name: Install knot
|
||||||
|
become: yes
|
||||||
apt:
|
apt:
|
||||||
|
update_cache: yes
|
||||||
pkg:
|
pkg:
|
||||||
- knot
|
- knot
|
||||||
- knot-dnsutils
|
- knot-dnsutils
|
||||||
|
|
||||||
- name: Update zones
|
- name: Update zones
|
||||||
|
become: yes
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: '{{ zones_dir }}/'
|
src: '{{ zones_dir }}/'
|
||||||
dest: /var/lib/knot/zones
|
dest: /var/lib/knot/zones
|
||||||
|
@ -15,13 +18,15 @@
|
||||||
notify: reload knot
|
notify: reload knot
|
||||||
when: "inventory_hostname in groups.primary"
|
when: "inventory_hostname in groups.primary"
|
||||||
|
|
||||||
- name:
|
- name: Deploy conf
|
||||||
|
become: yes
|
||||||
template:
|
template:
|
||||||
src: knot.conf.j2
|
src: knot.conf.j2
|
||||||
dest: /etc/knot/knot.conf
|
dest: /etc/knot/knot.conf
|
||||||
notify: reload knot
|
notify: reload knot
|
||||||
|
|
||||||
- name: Start knot
|
- name: Start knot
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: knot
|
name: knot
|
||||||
state: started
|
state: started
|
||||||
|
|
Loading…
Reference in a new issue