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

Make molecule pull community.general #64

Merged
merged 3 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
skip_list:
- fqcn-builtins
- syntax-check[specific]
- no-handler # Tasks that run when changed should likely be handlers.
3 changes: 3 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
collections:
- community.general
10 changes: 5 additions & 5 deletions tasks/create_ddns_keys.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
- name: determine if DDNS key already exists
- name: Determine if DDNS key already exists
become: false
delegate_to: localhost
stat:
path: "{{ bind9_local_keydir }}/{{ item.update_keyfile }}.private"
register: update_keyfile_tmp
when: item.update_keyfile is defined

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

- name: copy DDNS key to control host
- name: Copy DDNS key to control host
fetch:
src: "/etc/bind/keys/{{ item.update_keyfile }}.private"
dest: "{{ bind9_local_keydir }}/{{ item.update_keyfile }}.private"
flat: true
when: ddns_key.changed

- name: create dummy DDNS public key file on control host
- name: Create dummy DDNS public key file on control host
become: false
delegate_to: localhost
file:
path: "{{ bind9_local_keydir }}/{{ item.update_keyfile }}.key"
state: touch
when: ddns_key.changed
when: ddns_key.changed
5 changes: 3 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
group: "{{ bind9_group }}"
mode: 0644

- include_tasks: create_ddns_keys.yml
- name: Create dynamic DNS keys
include_tasks: create_ddns_keys.yml
with_items:
- "{{ bind9_zones_static + bind9_zones_dynamic }}"
when: bind9_generate_ddns_key | bool
Expand Down Expand Up @@ -336,7 +337,7 @@
tags:
- role:bind9:zones

- name: check validity of zone files
- name: Check validity of zone files
command: named-checkzone {{ item.name }} {{ bind9_zonedir }}/db.{{ item.name }}
register: bind9_reg_named_checkzone
become: true
Expand Down