Skip to content

Commit

Permalink
[skip travis] updates to last commit
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Mordant <[email protected]>
  • Loading branch information
Tcharl committed Mar 3, 2024
1 parent d82331a commit e7d73da
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tasks/ipa_dns_client.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
---

- name: Ipa_dns_client | ensure reverse zone is created
freeipa.ansible_freeipa.ipadnszone:
ipaadmin_password: "{{ company_realm_password }}"
name_from_ip: "{{ nameserver_current_host_ip.msg | ansible.utils.ipsubnet(8) }}"
ipaapi_context: server
state: present
failed_when: False # TODO too lazy to find a good regex that
no_log: "{{ secure_logs }}"
delegate_to: "{{ groups[idm_group][0] }}"
register: ptr_zone

- name: Ipa_dns_client | Display ptr zone name.
ansible.builtin.debug:
msg: "PTR Zone: {{ nameserver_current_host_ip.msg | ansible.utils.ipsubnet(8) | replace('.0.0.0/8', '') }}.in-addr.arpa"

- name: Ipa_dns_client | allow ptr sync on dns zone
freeipa.ansible_freeipa.ipadnszone:
ipaadmin_password: "{{ company_realm_password }}"
name: "{{ company_domain }}"
allow_sync_ptr: true
ipaapi_context: server
state: present
no_log: "{{ secure_logs }}"
delegate_to: "{{ groups[idm_group][0] }}"

- name: Ipa_dns_client | debug input params
ansible.builtin.debug:
Expand Down
26 changes: 26 additions & 0 deletions tasks/ipa_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

# Assuming all client machines are in the same domain and same /8 subnet , we can use the company_domain variable to set the dns zone.
- name: Ipa_dns_client | ensure reverse zone is created
freeipa.ansible_freeipa.ipadnszone:
ipaadmin_password: "{{ company_realm_password }}"
name_from_ip: "{{ nameserver_current_host_ip.msg | ansible.utils.ipsubnet(8) }}"
ipaapi_context: server
state: present
failed_when: False # TODO too lazy to find a good regex that
no_log: "{{ secure_logs }}"
register: ptr_zone

- name: Ipa_dns_client | Display ptr zone name.
ansible.builtin.debug:
msg: "PTR Zone: {{ nameserver_current_host_ip.msg | ansible.utils.ipsubnet(8) | replace('.0.0.0/8', '') }}.in-addr.arpa"

- name: Ipa_dns_client | allow ptr sync on dns zone
freeipa.ansible_freeipa.ipadnszone:
ipaadmin_password: "{{ company_realm_password }}"
name: "{{ company_domain }}"
allow_sync_ptr: true
ipaapi_context: server
state: present
no_log: "{{ secure_logs }}"

5 changes: 5 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
- name: Facts
ansible.builtin.include_tasks: facts.yml

- name: Ensure configure IPA server
ansible.builtin.include_tasks: ipa_server.yml
when:
- idm_group in group_names

- name: Ensure dns for IPA clients
ansible.builtin.include_tasks: ipa_dns_client.yml
when:
Expand Down

0 comments on commit e7d73da

Please sign in to comment.