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:
2025-10-19 22:25:19 +02:00
parent 0104e69124
commit 6c75e2910b
18 changed files with 549 additions and 239 deletions

View File

@@ -1,47 +1,62 @@
---
- name: Install required packages
apt:
ansible.builtin.package:
name:
- acl
- attr
- samba
- winbind
- libpam-winbind
- libnss-winbind
- krb5-config
- krb5-user
- winbind
- smbclient
- dnsutils
state: present
update_cache: yes
- dnsutils
- python3-setproctitle
# - smbclient
- ntp
state: latest
- name: Stop samba-ad-dc before provisioning (if running)
service:
ansible.builtin.service:
name: samba-ad-dc
state: stopped
enabled: no
ignore_errors: yes
- name: Provision AD domain
include_tasks: provision.yml
- name: Deploy smb.conf
template:
src: smb.conf.j2
dest: "{{ samba_conf_path }}"
owner: root
group: root
mode: '0644'
notify: Restart Samba AD DC
- name: Enable and start samba-ad-dc service
service:
name: samba-ad-dc
state: started
enabled: yes
- name: Configure Kerberos
include_tasks: kerberos.yml
- name: Set DNS resolver and hosts entry
include_tasks: dns_hosts.yml
- name: Run verification checks
include_tasks: verify.yml
when: samba_verify | bool
# - name: Check if backup exist
# - name: Provision AD domain
# include_tasks: provision.yml
# - name: Deploy smb.conf
# ansible.builtin.template:
# src: smb.conf.j2
# dest: "{{ samba_conf_path }}"
# owner: root
# group: root
# mode: '0644'
# notify: Restart Samba AD DC
# - name: Enable and start samba-ad-dc service
# ansible.builtin.service:
# name: samba-ad-dc
# state: started
# enabled: yes
# - name: Configure Kerberos
# include_tasks: kerberos.yml
# - name: Set DNS resolver and hosts entry
# include_tasks: dns_hosts.yml
# - name: Run verification checks
# include_tasks: verify.yml
# when: samba_verify | bool