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: - 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: