test
This commit is contained in:
parent
5da4fcc1e9
commit
6bee691284
2 changed files with 13 additions and 6 deletions
|
@ -16,17 +16,24 @@
|
||||||
|
|
||||||
- name: Generate tsig
|
- name: Generate tsig
|
||||||
become: yes
|
become: yes
|
||||||
ansible.builtin.shell: keymgr -t {{ key_name }} > /etc/knot/{{ key_name }}.key
|
ansible.builtin.shell:
|
||||||
args:
|
cmd: "keymgr -t {{ key_name }} > /etc/knot/{{ key_name }}.key"
|
||||||
creates: /etc/knot/{{ key_name }}.key
|
creates: "/etc/knot/{{ key_name }}.key"
|
||||||
when: "inventory_hostname in groups.primary"
|
run_once: True
|
||||||
|
|
||||||
- name: Fetch key
|
- name: Fetch key
|
||||||
become: yes
|
become: yes
|
||||||
ansible.builtin.slurp:
|
ansible.builtin.slurp:
|
||||||
src: /etc/knot/{{ key_name }}.key
|
src: /etc/knot/{{ key_name }}.key
|
||||||
register: tsig_key
|
register: tsig_key
|
||||||
when: "inventory_hostname in groups.primary"
|
run_once: True
|
||||||
|
|
||||||
|
- name: Populate key to all host
|
||||||
|
set_facts:
|
||||||
|
tsig_key_content: {{ tsig_key['content'] | b64decode }}
|
||||||
|
run_once: True
|
||||||
|
with_items: "{{ play_hosts }}"
|
||||||
|
delegate_to: "{{ item }}"
|
||||||
|
|
||||||
- name: Deploy conf
|
- name: Deploy conf
|
||||||
become: yes
|
become: yes
|
||||||
|
|
|
@ -7,7 +7,7 @@ log:
|
||||||
- target: syslog
|
- target: syslog
|
||||||
any: info
|
any: info
|
||||||
|
|
||||||
{{ tsig_key.content | b64decode }}
|
{{ tsig_key_content }}
|
||||||
|
|
||||||
remote:
|
remote:
|
||||||
{% for host in groups.all %}
|
{% for host in groups.all %}
|
||||||
|
|
Loading…
Reference in a new issue