You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
793 B

  1. ---
  2. - name: "Pre-upgrade | check if old credential dir exists"
  3. stat:
  4. path: "{{ inventory_dir }}/../credentials"
  5. delegate_to: localhost
  6. connection: local
  7. register: old_credential_dir
  8. become: no
  9. - name: "Pre-upgrade | check if new credential dir exists"
  10. stat:
  11. path: "{{ inventory_dir }}/credentials"
  12. delegate_to: localhost
  13. connection: local
  14. register: new_credential_dir
  15. become: no
  16. when: old_credential_dir.stat.exists
  17. - name: "Pre-upgrade | move data from old credential dir to new"
  18. command: mv {{ inventory_dir }}/../credentials {{ inventory_dir }}/credentials
  19. args:
  20. creates: "{{ inventory_dir }}/credentials"
  21. delegate_to: localhost
  22. connection: local
  23. become: no
  24. when:
  25. - old_credential_dir.stat.exists
  26. - not new_credential_dir.stat.exists