2019-02-18 21:36:09 +00:00
|
|
|
---
|
2018-10-07 10:57:36 +00:00
|
|
|
- name: copy private key
|
2017-10-08 12:55:01 +00:00
|
|
|
copy:
|
2019-02-18 21:36:09 +00:00
|
|
|
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
|
|
|
|
loop: '{{ bind_dnssec|product(file_ext)|list }}'
|
|
|
|
vars:
|
|
|
|
file_ext:
|
|
|
|
- ksk
|
|
|
|
- zsk
|
2017-10-08 12:55:01 +00:00
|
|
|
|
2018-10-07 10:57:36 +00:00
|
|
|
- name: copy public key
|
|
|
|
template:
|
|
|
|
src: public.key.j2
|
2019-02-18 21:36:09 +00:00
|
|
|
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
|
|
|
|
loop: '{{ bind_dnssec|product(file_ext)|list }}'
|
|
|
|
vars:
|
|
|
|
file_ext:
|
|
|
|
- ksk
|
|
|
|
- zsk
|