adapt role for LDAP
This commit is contained in:
parent
126d91202e
commit
d81fb9153a
@ -67,8 +67,15 @@
|
||||
ssh_key_file: .ssh/id_rsa # not required. Optionally specify the SSH key filename. If this is a relative filename then it will be relative to the user's home directory.
|
||||
uid: "{{ user.uid }}"
|
||||
shell: /bin/bash
|
||||
when: sssd_configure is not defined or sssd_configure == false
|
||||
|
||||
- name: simulate login
|
||||
stat:
|
||||
path: "/home/{{user.name}}"
|
||||
become: true
|
||||
become_user: "{{user.name}}"
|
||||
when: sssd_configure == true
|
||||
|
||||
- name : set sudoers right
|
||||
lineinfile:
|
||||
dest: '/etc/sudoers.d/{{user.name}}'
|
||||
regexp: '{{ item.regexp }}'
|
||||
@ -80,16 +87,15 @@
|
||||
mode: '0440'
|
||||
validate: 'visudo -cf "%s"'
|
||||
with_items:
|
||||
- regexp: '^%{{user.name}}\s'
|
||||
line: '%{{user.name}} ALL = (ALL) NOPASSWD:ALL'
|
||||
|
||||
- regexp: '^{{user.name}}\s'
|
||||
line: "{{user.name}} ALL = (ALL) NOPASSWD:ALL"
|
||||
|
||||
- name: Ensure /etc/sudoers includes /etc/sudoers.d
|
||||
lineinfile:
|
||||
dest: '/etc/sudoers'
|
||||
dest: "/etc/sudoers"
|
||||
regexp: '^#includedir\s+/etc/sudoers.d$'
|
||||
line: '#includedir /etc/sudoers.d'
|
||||
state: 'present'
|
||||
line: "#includedir /etc/sudoers.d"
|
||||
state: "present"
|
||||
validate: 'visudo -cf "%s"'
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user