avoid issues if files dont exist
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
91d6625115
commit
51fb64c770
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user