Matrix Docker Ansible eploy
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.
 
 

34 lines
954 B

  1. - name: Run export of /matrix/ and snapshot the database simultaneously
  2. command: "{{ item }}"
  3. with_items:
  4. - /bin/sh /usr/local/bin/awx-export-service.sh 1 0
  5. - /bin/sh /usr/local/bin/awx-export-service.sh 0 1
  6. register: _create_instances
  7. async: 3600 # Maximum runtime in seconds.
  8. poll: 0 # Fire and continue (never poll)
  9. - name: Wait for both of these jobs to finish
  10. async_status:
  11. jid: "{{ item.ansible_job_id }}"
  12. register: _jobs
  13. until: _jobs.finished
  14. delay: 5 # Check every 5 seconds.
  15. retries: 720 # Retry for a full hour.
  16. with_items: "{{ _create_instances.results }}"
  17. - name: Schedule deletion of the export in 24 hours
  18. at:
  19. command: rm /chroot/export/matrix*
  20. count: 1
  21. units: days
  22. unique: yes
  23. - name: Set boolean value to exit playbook
  24. set_fact:
  25. end_playbook: true
  26. - name: End playbook if this task list is called.
  27. meta: end_play
  28. when: end_playbook is defined and end_playbook|bool