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