Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

44 wiersze
1.3 KiB

  1. ---
  2. - name: Run export of /matrix/ and snapshot the database simultaneously
  3. command: "{{ item }}"
  4. with_items:
  5. - /bin/sh /usr/local/bin/awx-export-service.sh 1 0
  6. - /bin/sh /usr/local/bin/awx-export-service.sh 0 1
  7. register: awx_create_instances
  8. async: 3600 # Maximum runtime in seconds.
  9. poll: 0 # Fire and continue (never poll)
  10. - name: Wait for both of these jobs to finish
  11. async_status:
  12. jid: "{{ item.ansible_job_id }}"
  13. register: awx_jobs
  14. until: awx_jobs.finished
  15. delay: 5 # Check every 5 seconds.
  16. retries: 720 # Retry for a full hour.
  17. with_items: "{{ awx_create_instances.results }}"
  18. - name: Schedule deletion of the export in 24 hours
  19. at:
  20. command: rm /chroot/export/matrix*
  21. count: 1
  22. units: days
  23. unique: true
  24. - name: Delete the AWX session token for executing modules
  25. awx.awx.tower_token:
  26. description: 'AWX Session Token'
  27. scope: "write"
  28. state: absent
  29. existing_token_id: "{{ awx_session_token.ansible_facts.tower_token.id }}"
  30. tower_host: "https://{{ awx_host }}"
  31. tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
  32. - name: Set boolean value to exit playbook
  33. set_fact:
  34. awx_end_playbook: true
  35. - name: End playbook if this task list is called.
  36. meta: end_play
  37. when: awx_end_playbook is defined and awx_end_playbook|bool