Add present / absent condition on bashrc and authorized_keys file

This commit is contained in:
Dryusdan 2021-01-25 17:48:31 +01:00
parent 1470a277f3
commit 1feff6254c
1 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@
group: "{{ item.name }}"
mode: '0640'
loop: "{{ users }}"
when: item.state is not defined or item.state != "absent"
tags:
- create
@ -38,7 +39,7 @@
group: "{{ item.name }}"
mode: '0640'
loop: "{{ users }}"
when: item.authorized_keys is defined
when: item.authorized_keys is defined and (item.state is not defined or item.state != "absent")
tags:
- create