avoid issues if files dont exist
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2022-09-19 14:05:45 +02:00
parent 91d6625115
commit 51fb64c770
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0

View File

@ -1,5 +1,14 @@
---
- block:
- name: Stat umask files
stat:
path: "{{ item }}"
loop:
- /etc/bashrc
- /etc/csh.cshrc
- /etc/profile
register: __users_umask_files
- name: Override default .bashrc
template:
src: etc/bashrc.j2
@ -22,10 +31,7 @@
path: "{{ item }}"
regexp: '^(?i)(?P<umask>\s+UMASK\s+).+'
replace: \g<umask>{{ users_global_umask }}
loop:
- /etc/bashrc
- /etc/csh.cshrc
- /etc/profile
loop: "{{ __users_umask_files | json_query('results[?stat.exists].item') }}"
- name: Set umask in /etc/login.defs
lineinfile: