upgrade.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ---
  2. # input variables:
  3. # - openshift.common.service_type
  4. # - openshift.common.is_containerized
  5. # - docker_upgrade_nuke_images
  6. # - docker_version
  7. # - skip_docker_restart
  8. - name: Check Docker image count
  9. shell: "docker images -aq | wc -l"
  10. register: docker_image_count
  11. - debug: var=docker_image_count.stdout
  12. # TODO(jchaloup): put all docker_upgrade_nuke_images into a block with only one condition
  13. - name: Remove all containers and images
  14. script: nuke_images.sh
  15. register: nuke_images_result
  16. when: docker_upgrade_nuke_images is defined and docker_upgrade_nuke_images | bool
  17. - name: Check Docker image count
  18. shell: "docker images -aq | wc -l"
  19. register: docker_image_count
  20. when: docker_upgrade_nuke_images is defined and docker_upgrade_nuke_images | bool
  21. - debug: var=docker_image_count.stdout
  22. when: docker_upgrade_nuke_images is defined and docker_upgrade_nuke_images | bool
  23. - service:
  24. name: docker
  25. state: stopped
  26. register: l_openshift_node_upgrade_docker_stop_result
  27. until: not l_openshift_node_upgrade_docker_stop_result | failed
  28. retries: 3
  29. delay: 30
  30. - name: Upgrade Docker
  31. package: name=docker{{ '-' + docker_version }} state=present
  32. register: result
  33. until: result | success
  34. # starting docker happens back in ../main.yml where it calls ../restart.yml