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
899 B

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