webadmin-user.yml: fir some error backing up .bashrc file.
This commit is contained in:
parent
82e4cf0bd6
commit
1c2ca89268
@ -139,24 +139,46 @@
|
||||
# Copy .bashrc
|
||||
# ---
|
||||
|
||||
#- name: (webadmin-user.yml) Check if webadmin's file '.bashrc.ORIG' exists
|
||||
# stat:
|
||||
# path: "~{{ item.item.name }}/.bashrc.ORIG"
|
||||
# register: bashrc_webadmin_orig_exists
|
||||
# with_items: "{{ local_template_dir_webadmin.results }}"
|
||||
# loop_control:
|
||||
# label: '{{ item.item.name }}'
|
||||
# when:
|
||||
# - item.stat.exists
|
||||
# tags:
|
||||
# - webadmin
|
||||
# - bash
|
||||
#
|
||||
#- name: (webadmin-user.yml) Backup existing webadmin's .bashrc file
|
||||
# command: cp ~{{ item.item.item.name }}/.bashrc ~{{ item.item.item.name }}/.bashrc.ORIG
|
||||
# loop: "{{ bashrc_webadmin_orig_exists.results }}"
|
||||
# loop_control:
|
||||
# label: '{{ item.item.item.name }}'
|
||||
# when:
|
||||
# - item.stat.exists == False
|
||||
# tags:
|
||||
# - webadmin
|
||||
# - bash
|
||||
|
||||
- name: (webadmin-user.yml) Check if webadmin's file '.bashrc.ORIG' exists
|
||||
stat:
|
||||
path: "~{{ item.item.name }}/.bashrc.ORIG"
|
||||
path: "~{{ item.name }}/.bashrc.ORIG"
|
||||
register: bashrc_webadmin_orig_exists
|
||||
with_items: "{{ local_template_dir_webadmin.results }}"
|
||||
with_items: "{{ webadmin_user }}"
|
||||
loop_control:
|
||||
label: '{{ item.item.name }}'
|
||||
when:
|
||||
- item.stat.exists
|
||||
label: '{{ item.name }}'
|
||||
tags:
|
||||
- webadmin
|
||||
- bash
|
||||
|
||||
- name: (webadmin-user.yml) Backup existing webadmin's .bashrc file
|
||||
command: cp ~{{ item.item.name }}/.bashrc ~{{ item.item.name }}/.bashrc.ORIG
|
||||
command: cp -a ~{{ item.item.name }}/.bashrc ~{{ item.item.name }}/.bashrc.ORIG
|
||||
loop: "{{ bashrc_webadmin_orig_exists.results }}"
|
||||
loop_control:
|
||||
label: '{{ item.stat.pw_name }}'
|
||||
label: '{{ item.item.name }}'
|
||||
when:
|
||||
- item.stat.exists == False
|
||||
tags:
|
||||
@ -196,7 +218,7 @@
|
||||
- profile
|
||||
|
||||
- name: (webadmin-user.yml) Backup existing users .profile file
|
||||
command: cp ~{{ item.item.name }}/.profile ~{{ item.item.name }}/.profile.ORIG
|
||||
command: cp -a ~{{ item.item.name }}/.profile ~{{ item.item.name }}/.profile.ORIG
|
||||
with_items: "{{ profile_webadmin_orig_exists.results }}"
|
||||
loop_control:
|
||||
label: '{{ item.item.name }}'
|
||||
|
Loading…
Reference in New Issue
Block a user