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.

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