diff --git a/roles/samba/defaults/main.yml b/roles/samba/defaults/main.yml index 9a1f560..24d6927 100644 --- a/roles/samba/defaults/main.yml +++ b/roles/samba/defaults/main.yml @@ -64,13 +64,6 @@ samba_pwd_policy_descriptions: account-lockout-threshold: Account lockout threshold \(attempts\) reset-account-lockout-after: Reset account lockout after \(mins\) -# The DNS zones to create: -# samba_dns_zones: -# - 99.10.in-addr.arpa -# - sub.domain.com -# Set to True if you want zones not managed by ansible to be removed -samba_remove_unmanaged_dns_zones: False - # List of DNS servers to which requests for non local domains should be forwarded # samba_dns_forwarder: diff --git a/roles/samba/tasks/conf.yml b/roles/samba/tasks/conf.yml index 19b1cff..2f88ea9 100644 --- a/roles/samba/tasks/conf.yml +++ b/roles/samba/tasks/conf.yml @@ -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: