Only attempt to copy the old users file if it actually exists
This commit is contained in:
parent
2d8192ac09
commit
ec3465a60c
1 changed files with 6 additions and 0 deletions
|
|
@ -2,12 +2,18 @@
|
||||||
- name: set fact manage_file_users
|
- name: set fact manage_file_users
|
||||||
set_fact: manage_file_users=es_users is defined and es_users.file is defined and es_users.file.keys() | length > 0
|
set_fact: manage_file_users=es_users is defined and es_users.file is defined and es_users.file.keys() | length > 0
|
||||||
|
|
||||||
|
- name: Check if old users file exists
|
||||||
|
stat:
|
||||||
|
path: '{{ conf_dir }}/x-pack/users'
|
||||||
|
register: old_users_file
|
||||||
|
|
||||||
- name: Copy the old users file from the old depreacted location
|
- name: Copy the old users file from the old depreacted location
|
||||||
copy:
|
copy:
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
force: no # only copy it if the new path doesn't exist yet
|
force: no # only copy it if the new path doesn't exist yet
|
||||||
src: "{{ conf_dir }}/x-pack/users"
|
src: "{{ conf_dir }}/x-pack/users"
|
||||||
dest: "{{ conf_dir }}{{ es_xpack_conf_subdir }}/users"
|
dest: "{{ conf_dir }}{{ es_xpack_conf_subdir }}/users"
|
||||||
|
when: old_users_file.stat.exists
|
||||||
|
|
||||||
- name: Create the users file if it doesn't exist
|
- name: Create the users file if it doesn't exist
|
||||||
copy:
|
copy:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue