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.

40 lines
1.4 KiB

  1. ---
  2. - name: container_download | Make download decision if pull is required by tag or sha256
  3. include_tasks: set_docker_image_facts.yml
  4. when:
  5. - download.enabled
  6. - download.container
  7. tags:
  8. - facts
  9. # FIXME(mattymo): In Ansible 2.4 omitting download delegate is broken. Move back
  10. # to one task in the future.
  11. - name: container_download | Download containers if pull is required or told to always pull (delegate)
  12. command: "{{ docker_bin_dir }}/docker pull {{ pull_args }}"
  13. register: pull_task_result
  14. until: pull_task_result is succeeded
  15. retries: 4
  16. delay: "{{ retry_stagger | random + 3 }}"
  17. changed_when: not 'up to date' in pull_task_result.stdout
  18. when:
  19. - download_run_once
  20. - download.enabled
  21. - download.container
  22. - any_pull_required | default(download_always_pull)
  23. delegate_to: "{{ download_delegate }}"
  24. delegate_facts: yes
  25. run_once: yes
  26. - name: container_download | Download containers if pull is required or told to always pull (all nodes)
  27. command: "{{ docker_bin_dir }}/docker pull {{ pull_args }}"
  28. register: pull_task_result
  29. until: pull_task_result is succeeded
  30. retries: 4
  31. delay: "{{ retry_stagger | random + 3 }}"
  32. changed_when: not 'up to date' in pull_task_result.stdout
  33. when:
  34. - not download_run_once
  35. - download.enabled
  36. - download.container
  37. - pull_required|default(download_always_pull)
  38. - group_names | intersect(download.groups) | length