Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly copy generated ddns key to control host #75

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tasks/create_ddns_keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
when: item.update_keyfile is defined

- name: Generate DDNS key
ansible.builtin.shell: "tsig-keygen -a {{ item.update_key_algorithm | d('hmac-sha512') }} {{ item.name }}_{{ item.update_keyfile }}_update > /etc/bind/keys/{{ item.update_keyfile }}.private"
ansible.builtin.shell: "tsig-keygen -a {{ item.update_key_algorithm | d('hmac-sha512') }} {{ item.name }}_{{ item.update_keyfile }}_update > {{ bind9_keydir }}/{{ item.update_keyfile }}.private"
args:
chdir: "{{ bind9_zonedir }}"
register: ddns_key
changed_when: ddns_key.rc != 0
changed_when: ddns_key.rc == 0
when: item.update_keyfile is defined and not update_keyfile_tmp.stat.exists

- name: Copy DDNS key to control host
ansible.builtin.fetch:
src: "/etc/bind/keys/{{ item.update_keyfile }}.private"
src: "{{ bind9_keydir }}/{{ item.update_keyfile }}.private"
dest: "{{ bind9_local_keydir }}/{{ item.update_keyfile }}.private"
mode: "0640"
flat: true
Expand Down