2018-04-02 16:19:23 +08:00
|
|
|
---
|
|
|
|
- name: "Pre-upgrade | check if old credential dir exists"
|
2018-08-14 22:08:43 +08:00
|
|
|
stat:
|
2018-04-02 16:19:23 +08:00
|
|
|
path: "{{ inventory_dir }}/../credentials"
|
2018-08-14 22:08:43 +08:00
|
|
|
delegate_to: localhost
|
2020-06-25 23:14:38 +08:00
|
|
|
connection: local
|
2018-04-02 16:19:23 +08:00
|
|
|
register: old_credential_dir
|
|
|
|
become: no
|
|
|
|
|
|
|
|
- name: "Pre-upgrade | check if new credential dir exists"
|
2018-08-14 22:08:43 +08:00
|
|
|
stat:
|
2018-04-02 16:19:23 +08:00
|
|
|
path: "{{ inventory_dir }}/credentials"
|
2018-08-14 22:08:43 +08:00
|
|
|
delegate_to: localhost
|
2020-06-25 23:14:38 +08:00
|
|
|
connection: local
|
2018-04-02 16:19:23 +08: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 22:08:43 +08:00
|
|
|
command: mv {{ inventory_dir }}/../credentials {{ inventory_dir }}/credentials
|
2018-04-02 16:19:23 +08:00
|
|
|
args:
|
|
|
|
creates: "{{ inventory_dir }}/credentials"
|
2018-08-14 22:08:43 +08:00
|
|
|
delegate_to: localhost
|
2020-06-25 23:14:38 +08:00
|
|
|
connection: local
|
2018-04-02 16:19:23 +08:00
|
|
|
become: no
|
2018-08-26 02:33:31 +08:00
|
|
|
when:
|
|
|
|
- old_credential_dir.stat.exists
|
|
|
|
- not new_credential_dir.stat.exists
|