Feat: migrate from with_X to loop

Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
This commit is contained in:
Hadrien Patte 2019-03-23 19:49:13 +01:00
parent c20d4fbf18
commit 66f7b1061a
No known key found for this signature in database
GPG key ID: 0954F2874A54F4B1
4 changed files with 16 additions and 16 deletions

View file

@ -61,8 +61,8 @@
# User skeleton # User skeleton
- name: Configure user skeleton - name: Configure user skeleton
copy: copy:
src: skel/{{ item.key }} src: skel/dot_{{ item.key }}
dest: /etc/skel/{{ item.value }} dest: /etc/skel/.{{ item.value }}
with_dict: loop:
dot_zshrc: .zshrc - zshrc
dot_zshrc.local: .zshrc.local - zshrc.local

View file

@ -32,11 +32,11 @@
- name: Configure NSS to use LDAP - name: Configure NSS to use LDAP
lineinfile: lineinfile:
dest: /etc/nsswitch.conf dest: /etc/nsswitch.conf
regexp: "^{{ item.key }}:" regexp: "^{{ item }}:"
line: "{{ item.value }}" line: "{{ item }}: files ldap"
with_dict: loop:
passwd: 'passwd: files ldap' - passwd
group: 'group: files ldap' - group
shadow: 'shadow: files ldap' - shadow
sudoers: 'sudoers: files ldap' - sudoers
notify: Restart nslcd service notify: Restart nslcd service

View file

@ -5,7 +5,7 @@
src: "{{ item }}.j2" src: "{{ item }}.j2"
dest: /usr/local/bin/{{ item }} dest: /usr/local/bin/{{ item }}
mode: 0755 mode: 0755
with_items: loop:
- chsh - chsh
- passwd - passwd

View file

@ -31,7 +31,7 @@
file: file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
with_items: loop:
- /etc/ldap/slapd.d - /etc/ldap/slapd.d
- /var/lib/ldap - /var/lib/ldap
@ -40,7 +40,7 @@
file: file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
with_items: loop:
- /etc/ldap/slapd.d - /etc/ldap/slapd.d
- /var/lib/ldap - /var/lib/ldap
@ -56,7 +56,7 @@
owner: openldap owner: openldap
group: openldap group: openldap
recurse: true recurse: true
with_items: loop:
- /var/lib/ldap - /var/lib/ldap
- /etc/ldap/slapd.d - /etc/ldap/slapd.d