|
|
|
@ -143,42 +143,6 @@ |
|
|
|
|
- item.stdout | string != samba_pwd_policy[item.item] | string |
|
|
|
|
tags: samba |
|
|
|
|
|
|
|
|
|
- name: Add default zones to the list of managed ones |
|
|
|
|
set_fact: samba_dns_zones={{ samba_dns_zones | default([]) + [ samba_realm | lower, '_msdcs.' + samba_realm | lower ] }} |
|
|
|
|
when: samba_i_am_primary_dc == True |
|
|
|
|
tags: samba |
|
|
|
|
|
|
|
|
|
- name: Check existing DNS zones |
|
|
|
|
shell: | |
|
|
|
|
samba-tool dns zonelist {{ ansible_all_ipv4_addresses | first }} \ |
|
|
|
|
-U Administrator --password={{ samba_dc_admin_pass | quote }} | \ |
|
|
|
|
perl -ne 'm/pszZoneName\s+:\s+(.*)/ && print "$1\n"' |
|
|
|
|
register: samba_existing_zones |
|
|
|
|
no_log: True |
|
|
|
|
changed_when: False |
|
|
|
|
when: samba_i_am_primary_dc == True |
|
|
|
|
tags: samba |
|
|
|
|
|
|
|
|
|
- name: Create DNS zones |
|
|
|
|
command: >- |
|
|
|
|
samba-tool dns zonecreate {{ ansible_all_ipv4_addresses | first }} |
|
|
|
|
{{ item }} -U Administrator --password={{ samba_dc_admin_pass | quote }} |
|
|
|
|
no_log: True |
|
|
|
|
when: samba_i_am_primary_dc == True |
|
|
|
|
with_items: "{{ samba_dns_zones | difference(samba_existing_zones.stdout_lines) }}" |
|
|
|
|
tags: samba |
|
|
|
|
|
|
|
|
|
- name: Remove DNS zones |
|
|
|
|
command: >- |
|
|
|
|
samba-tool dns zonedelete {{ ansible_all_ipv4_addresses | first }} |
|
|
|
|
{{ item }} -U Administrator --password={{ samba_dc_admin_pass | quote }} |
|
|
|
|
no_log: True |
|
|
|
|
when: |
|
|
|
|
- samba_i_am_primary_dc == True |
|
|
|
|
- samba_remove_unmanaged_dns_zones == True |
|
|
|
|
with_items: "{{ samba_existing_zones.stdout_lines | difference(samba_dns_zones) }}" |
|
|
|
|
tags: samba |
|
|
|
|
|
|
|
|
|
- name: Deploy pre and post backup script |
|
|
|
|
template: src={{ item.src }} dest={{ item.dest }} mode=755 |
|
|
|
|
with_items: |
|
|
|
|