Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
---
- name: Install sssd and the needed tools
apt:
name:
- sssd
- libnss-sss
- libpam-sss
- ca-certificates
tags: auth
- name: Install oddjob-mkhomedir
apt:
name:
- oddjob-mkhomedir
when: ansible_distribution_major_version is version('9', '>=')
notify: restart oddjobd
tags: auth

View File

@@ -0,0 +1,9 @@
---
- name: Install sssd and the needed tools
yum:
name:
- sssd
- oddjob-mkhomedir
- authconfig
tags: auth

View File

@@ -0,0 +1,42 @@
---
- include: install_{{ ansible_os_family }}.yml
- name: Deploy sssd config
template: src=sssd.conf.j2 dest=/etc/sssd/sssd.conf owner=root group=root mode=0600
register: sssd_config
notify: restart sssd
tags: auth
# On el8 for example, sssd is already installed and running on a default setup
# so we need to restart it now, so users are available (for eg, ssh authorized_keys setup)
# We can't rely on the handler, because it would only run at the end of the playbook
- name: Restart sssd if needed
service: name=sssd state=restarted
when: sssd_config.changed
tags: auth
- name: Ensure nsswitch is using sssd
lineinfile:
dest: /etc/nsswitch.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- regexp: '^passwd:.*'
line: 'passwd: files sss'
- regexp: '^shadow:.*'
line: 'shadow: files sss'
- regexp: '^group:.*'
line: 'group: files sss'
tags: auth
- name: Start and enable sssd service
service: name=sssd state=started enabled=True
tags: auth
- name: Start oddjobd
service: name=oddjobd state=started enabled=True
when: ansible_distribution != 'Debian' or ansible_distribution_major_version is version('9', '>=')
tags: auth
- include: pam_{{ ansible_os_family }}.yml

View File

@@ -0,0 +1,10 @@
---
- name: Deploy pam config
template: src=deb_pam_common_{{ item }}.j2 dest=/etc/pam.d/common-{{ item }}
with_items:
- account
- auth
- password
- session
tags: auth

View File

@@ -0,0 +1,13 @@
---
- name: Check if authconfig needs to update pam config
command: "grep -P '^auth\\s+sufficient\\s+pam_sss.so' /etc/pam.d/system-auth"
register: auth_sss_done
changed_when: False
failed_when: False
tags: auth
- name: Configure authentication with authconfig
command: authconfig --enablemkhomedir --enablesssd --enablesssdauth --update
when: auth_sss_done.rc != 0
tags: auth