2017-07-18 14:23:07 +02:00
|
|
|
---
|
|
|
|
# tasks file for ansible-role-sssd
|
|
|
|
|
|
|
|
- name: Load specific OS vars
|
|
|
|
include_vars: "{{ item }}"
|
|
|
|
with_first_found:
|
|
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
|
|
|
|
- "{{ ansible_distribution|lower }}.yml"
|
|
|
|
- "{{ ansible_os_family|lower }}.yml"
|
|
|
|
|
|
|
|
# Packages
|
|
|
|
- name: Install sssd
|
|
|
|
package:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: "{{ sssd_pkg_state }}"
|
|
|
|
with_items: "{{ sssd_pkg_list }}"
|
|
|
|
|
2017-08-21 16:27:36 +02:00
|
|
|
# Update nsswitch.conf
|
|
|
|
- name: CONFIG sudoers nsswitch.conf
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/nsswitch.conf
|
2017-09-07 13:46:52 +02:00
|
|
|
state: present
|
|
|
|
regexp: '^sudoers:'
|
2017-08-21 16:27:36 +02:00
|
|
|
line: 'sudoers: files'
|
2017-09-07 13:46:52 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2017-08-21 16:27:36 +02:00
|
|
|
when: not sssd_sudoers_ldap
|
|
|
|
|
2017-07-18 14:23:07 +02:00
|
|
|
# Configuration file
|
|
|
|
- name: CONFIG sssd.conf
|
|
|
|
template:
|
|
|
|
src: "{{ sssd_main_conf_tpl }}"
|
|
|
|
dest: "{{ sssd_main_conf_path }}"
|
|
|
|
mode: 0600
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
backup: true
|
|
|
|
when: sssd_conf_manage
|
|
|
|
notify:
|
|
|
|
- restart sssd
|
2017-09-08 09:15:05 +02:00
|
|
|
- restart logind
|
2017-07-18 14:23:07 +02:00
|
|
|
|
|
|
|
- name: "CONFIG conf.d/{{ sssd_domain }}.conf"
|
|
|
|
blockinfile:
|
|
|
|
state: present
|
|
|
|
create: yes
|
|
|
|
mode: 0600
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
insertbefore: BOF
|
|
|
|
dest: "/etc/sssd/conf.d/{{ sssd_domain }}.conf"
|
|
|
|
content: |
|
|
|
|
[domain/{{ sssd_domain }}]
|
|
|
|
#ldap_default_authtok = password for {{ sssd_bind_dn }} after END BLOCK
|
2017-09-18 15:29:59 +02:00
|
|
|
{% if sssd_bind_password %} ldap_default_authtok = {{ sssd_bind_password }}{% endif %}
|
2017-07-18 14:23:07 +02:00
|
|
|
when: sssd_conf_manage
|
|
|
|
notify:
|
|
|
|
- restart sssd
|
2017-09-08 09:15:05 +02:00
|
|
|
- restart logind
|
2017-07-18 14:23:07 +02:00
|
|
|
|
|
|
|
- name: Ensure home directories are created upon login with pam
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/pam.d/common-account
|
|
|
|
regexp: 'pam_mkhomedir\.so'
|
|
|
|
line: "session required pam_mkhomedir.so umask=0022 skel=/etc/skel/ silent"
|
|
|
|
state: present
|
|
|
|
when: sssd_mkhomedir
|