refactor ♻️: Update ntp.conf to use AD DCs, configure winbind, and enable SMB service with appropriate ID mapping.
Refactored the ntp configuration to include AD domain controllers, updated winbind settings for local BUILTIN accounts, and enabled SMB service with proper ID mapping.
This commit is contained in:
@@ -93,6 +93,13 @@
|
||||
ignore_errors: yes
|
||||
|
||||
# Configure ntp.conf to use AD DCs
|
||||
- name: Ensure 'tinker panic 0' is present
|
||||
lineinfile:
|
||||
path: /etc/ntp.conf
|
||||
line: "tinker panic 0"
|
||||
insertafter: BOF
|
||||
state: present
|
||||
|
||||
- name: Configure ntp.conf with AD domain controllers
|
||||
blockinfile:
|
||||
path: /etc/ntp.conf
|
||||
@@ -134,6 +141,26 @@
|
||||
register: join_result
|
||||
changed_when: "'Joined domain' in join_result.stdout"
|
||||
|
||||
# Ensure winbind is appended to passwd and group in /etc/nsswitch.conf
|
||||
- name: Ensure winbind is appended to passwd and group NSS databases
|
||||
lineinfile:
|
||||
path: /etc/nsswitch.conf
|
||||
regexp: '^{{ item }}:'
|
||||
line: "{{ item }}: files winbind"
|
||||
backrefs: yes
|
||||
loop:
|
||||
- passwd
|
||||
- group
|
||||
|
||||
# Append [success=continue] winbind to existing initgroups line
|
||||
- name: Ensure [success=continue] winbind is present in initgroups line if it exists
|
||||
replace:
|
||||
path: /etc/nsswitch.conf
|
||||
regexp: '^(initgroups:.*?)(\s*winbind)?$'
|
||||
replace: '\1 [success=continue] winbind'
|
||||
when: "'initgroups:' in lookup('file', '/etc/nsswitch.conf')"
|
||||
|
||||
|
||||
- name: Enable and start required services
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
|
||||
Reference in New Issue
Block a user