patch undefined: Updated the DNS configuration in the resolv.conf.j2 template to include both the local host and the Ansible-managed DNS server.
Added a new line to the `resolv.conf.j2` template to specify the Ansible-managed DNS server (`{{ addc_ansible_host }}`). This ensures that the system uses both the local host and the managed DNS server for DNS resolution.
This commit is contained in:
@@ -1,37 +1,15 @@
|
||||
---
|
||||
---
|
||||
- name: Ensure Samba log directory exists
|
||||
file:
|
||||
path: "{{ samba_log_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Provision the Samba AD DC (with logging)
|
||||
command: >
|
||||
- name: Provision the Samba AD DC
|
||||
ansible.builtin.command: >
|
||||
samba-tool domain provision
|
||||
--use-rfc2307
|
||||
--realm={{ samba_realm }}
|
||||
--domain={{ samba_domain }}
|
||||
--server-role=dc
|
||||
--dns-backend={{ samba_dns_backend }}
|
||||
--adminpass={{ samba_admin_password }}
|
||||
args:
|
||||
creates: "{{ samba_samdb_path }}"
|
||||
--realm={{ addc_auth_domain }}
|
||||
--domain={{ addc_netbios_domain }}
|
||||
--server-role={{ addc_server_role }}
|
||||
--dns-backend={{ addc_dns_backend }}
|
||||
--adminpass={{ addc_admin_password }}
|
||||
--option="interfaces=lo eth0"
|
||||
--option="bind interfaces only=yes"
|
||||
register: samba_provision_output
|
||||
no_log: false # You may toggle this if password should be hidden
|
||||
|
||||
- name: Write provisioning output to log
|
||||
copy:
|
||||
content: "{{ samba_provision_output.stdout }}"
|
||||
dest: "{{ samba_provision_log_file }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Redact passwords in provisioning log (optional)
|
||||
replace:
|
||||
path: "{{ samba_provision_log_file }}"
|
||||
regexp: "--adminpass=.*"
|
||||
replace: "--adminpass=********"
|
||||
changed_when: samba_provision_output.rc == 0
|
||||
no_log: true # You may toggle this if password should be hidden
|
||||
|
||||
Reference in New Issue
Block a user