ansible-role-bind/tasks/keys.yml

33 lines
848 B
YAML
Raw Normal View History

---
2023-06-30 09:16:45 +00:00
- name: Copy private key
ansible.builtin.copy:
dest: "/etc/bind/keys/K{{ item.0 }}.\
+{{ '00{}'.format(bind_dnssec[item.0][item.1].algorithm)[-3:] }}\
+{{ bind_dnssec[item.0][item.1].tag }}.private"
2018-10-07 10:57:36 +00:00
content: '{{ bind_dnssec[item.0][item.1].private_key }}'
2017-10-08 12:55:01 +00:00
owner: root
group: bind
mode: 0640
2018-12-05 09:16:43 +00:00
no_log: true
2023-06-30 09:16:45 +00:00
loop: '{{ bind_dnssec | product(file_ext) | list }}'
2018-12-05 09:16:43 +00:00
vars:
file_ext:
- ksk
- zsk
2017-10-08 12:55:01 +00:00
2023-06-30 09:16:45 +00:00
- name: Copy public key
ansible.builtin.template:
2018-10-07 10:57:36 +00:00
src: public.key.j2
dest: "/etc/bind/keys/K{{ item.0 }}.\
+{{ '00{}'.format(bind_dnssec[item.0][item.1].algorithm)[-3:] }}\
+{{ bind_dnssec[item.0][item.1].tag }}.key"
2017-10-08 12:55:01 +00:00
owner: root
group: bind
mode: 0640
2018-12-05 09:16:43 +00:00
no_log: true
2023-06-30 09:16:45 +00:00
loop: '{{ bind_dnssec | product(file_ext) | list }}'
2018-12-05 09:16:43 +00:00
vars:
file_ext:
- ksk
- zsk