2018-04-02 08:19:23 +00:00
|
|
|
---
|
|
|
|
- name: "Pre-upgrade | check if old credential dir exists"
|
2018-08-14 14:08:43 +00:00
|
|
|
stat:
|
2018-04-02 08:19:23 +00:00
|
|
|
path: "{{ inventory_dir }}/../credentials"
|
2018-08-14 14:08:43 +00:00
|
|
|
delegate_to: localhost
|
2020-06-25 15:14:38 +00:00
|
|
|
connection: local
|
2018-04-02 08:19:23 +00:00
|
|
|
register: old_credential_dir
|
|
|
|
become: no
|
|
|
|
|
|
|
|
- name: "Pre-upgrade | check if new credential dir exists"
|
2018-08-14 14:08:43 +00:00
|
|
|
stat:
|
2018-04-02 08:19:23 +00:00
|
|
|
path: "{{ inventory_dir }}/credentials"
|
2018-08-14 14:08:43 +00:00
|
|
|
delegate_to: localhost
|
2020-06-25 15:14:38 +00:00
|
|
|
connection: local
|
2018-04-02 08:19:23 +00:00
|
|
|
register: new_credential_dir
|
|
|
|
become: no
|
|
|
|
when: old_credential_dir.stat.exists
|
|
|
|
|
|
|
|
- name: "Pre-upgrade | move data from old credential dir to new"
|
2018-08-14 14:08:43 +00:00
|
|
|
command: mv {{ inventory_dir }}/../credentials {{ inventory_dir }}/credentials
|
2018-04-02 08:19:23 +00:00
|
|
|
args:
|
|
|
|
creates: "{{ inventory_dir }}/credentials"
|
2018-08-14 14:08:43 +00:00
|
|
|
delegate_to: localhost
|
2020-06-25 15:14:38 +00:00
|
|
|
connection: local
|
2018-04-02 08:19:23 +00:00
|
|
|
become: no
|
2018-08-25 18:33:31 +00:00
|
|
|
when:
|
|
|
|
- old_credential_dir.stat.exists
|
|
|
|
- not new_credential_dir.stat.exists
|