Update to 2021-09-22 19:00

master
Daniel Berteaud 3 years ago
parent 598f8aaee4
commit f4466ce490
  1. 7
      roles/samba/defaults/main.yml
  2. 36
      roles/samba/tasks/conf.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:

@ -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:

Loading…
Cancel
Save