Feat: migrate from with_X to loop
Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
This commit is contained in:
parent
c20d4fbf18
commit
66f7b1061a
4 changed files with 16 additions and 16 deletions
|
@ -61,8 +61,8 @@
|
|||
# User skeleton
|
||||
- name: Configure user skeleton
|
||||
copy:
|
||||
src: skel/{{ item.key }}
|
||||
dest: /etc/skel/{{ item.value }}
|
||||
with_dict:
|
||||
dot_zshrc: .zshrc
|
||||
dot_zshrc.local: .zshrc.local
|
||||
src: skel/dot_{{ item.key }}
|
||||
dest: /etc/skel/.{{ item.value }}
|
||||
loop:
|
||||
- zshrc
|
||||
- zshrc.local
|
||||
|
|
|
@ -32,11 +32,11 @@
|
|||
- name: Configure NSS to use LDAP
|
||||
lineinfile:
|
||||
dest: /etc/nsswitch.conf
|
||||
regexp: "^{{ item.key }}:"
|
||||
line: "{{ item.value }}"
|
||||
with_dict:
|
||||
passwd: 'passwd: files ldap'
|
||||
group: 'group: files ldap'
|
||||
shadow: 'shadow: files ldap'
|
||||
sudoers: 'sudoers: files ldap'
|
||||
regexp: "^{{ item }}:"
|
||||
line: "{{ item }}: files ldap"
|
||||
loop:
|
||||
- passwd
|
||||
- group
|
||||
- shadow
|
||||
- sudoers
|
||||
notify: Restart nslcd service
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
src: "{{ item }}.j2"
|
||||
dest: /usr/local/bin/{{ item }}
|
||||
mode: 0755
|
||||
with_items:
|
||||
loop:
|
||||
- chsh
|
||||
- passwd
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
loop:
|
||||
- /etc/ldap/slapd.d
|
||||
- /var/lib/ldap
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
|||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
loop:
|
||||
- /etc/ldap/slapd.d
|
||||
- /var/lib/ldap
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
owner: openldap
|
||||
group: openldap
|
||||
recurse: true
|
||||
with_items:
|
||||
loop:
|
||||
- /var/lib/ldap
|
||||
- /etc/ldap/slapd.d
|
||||
|
||||
|
|
Loading…
Reference in a new issue