diff --git a/roles/services/tasks/adsamba.yml b/roles/services/tasks/adsamba.yml index 0449343..a48dbe2 100644 --- a/roles/services/tasks/adsamba.yml +++ b/roles/services/tasks/adsamba.yml @@ -25,9 +25,6 @@ # apt: # update_cache: yes -- name: Gather installed packages - package_facts: - - name: Install adSamba packages package: name: "{{ dcsamba_base_packages }}" @@ -90,6 +87,37 @@ enabled: yes when: domain_join.changed + - name: Extracting variables + no_log: true + set_fact: + passwords: "{{ lookup(passbolt, key_name, folder_parent_id=passbolt_folder).password }}" + + - name: Add A record to DNS + nsupdate: + key_name: '{{ key_name }}' + key_secret: '{{ passwords }}' + key_algorithm: '{{ key_algorithm }}' + server: "{{ main_dns_server }}" + zone: '{{ resolv_domain }}' + ttl: '{{ ttl }}' + type: 'A' + record: '{{ name_ad }}.{{ realm }}.' + value: '{{ ip_serverad }}' + state: present + + - name: Add NS record to DNS + nsupdate: + key_name: '{{ key_name }}' + key_secret: '{{ passwords }}' + key_algorithm: '{{ key_algorithm }}' + server: '{{ main_dns_server }}' + zone: '{{ resolv_domain }}' + ttl: '{{ ttl }}' + type: 'NS' + record: '{{ realm }}.' + value: '{{ name_ad }}.{{ realm }}.' + state: present + - name: Disable Samba client services and mask them systemd: name: "{{ item }}" @@ -97,35 +125,3 @@ enabled: no masked: yes loop: "{{ samba_client_services }}" - -- name: Extracting variables - no_log: true - set_fact: - passwords: "{{ lookup(passbolt, key_name, folder_parent_id=passbolt_folder).password }}" - -- name: Add A record to DNS - nsupdate: - key_name: '{{ key_name }}' - key_secret: '{{ passwords }}' - key_algorithm: '{{ key_algorithm }}' - server: "{{ main_dns_server }}" - zone: '{{ resolv_domain }}' - ttl: '{{ ttl }}' - type: 'A' - record: '{{ name_ad }}.{{ realm }}.' - value: '{{ ip_serverad }}' - state: present - -- name: Add NS record to DNS - nsupdate: - key_name: '{{ key_name }}' - key_secret: '{{ passwords }}' - key_algorithm: '{{ key_algorithm }}' - server: '{{ main_dns_server }}' - zone: '{{ resolv_domain }}' - ttl: '{{ ttl }}' - type: 'NS' - record: '{{ realm }}.' - value: '{{ name_ad }}.{{ realm }}.' - state: present -