123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- ---
- # We need docker service up to remove all the images, but these services will keep
- # trying to re-start and thus re-pull the images we're trying to delete.
- - name: Stop containerized services
- service: name={{ item }} state=stopped
- with_items:
- - "{{ openshift_service_type }}-master-api"
- - "{{ openshift_service_type }}-master-controllers"
- - "{{ openshift_service_type }}-node"
- - etcd_container
- - openvswitch
- failed_when: false
- when: openshift_is_containerized | bool
- - name: Check Docker image count
- shell: "docker images -aq | wc -l"
- register: docker_image_count
- - debug: var=docker_image_count.stdout
- - name: Remove all containers and images
- script: nuke_images.sh
- register: nuke_images_result
- when: docker_upgrade_nuke_images is defined and docker_upgrade_nuke_images | bool
- - name: Check Docker image count
- shell: "docker images -aq | wc -l"
- register: docker_image_count
- when: docker_upgrade_nuke_images is defined and docker_upgrade_nuke_images | bool
- - debug: var=docker_image_count.stdout
- when: docker_upgrade_nuke_images is defined and docker_upgrade_nuke_images | bool
- - service:
- name: docker
- state: stopped
- register: l_pb_docker_upgrade_stop_result
- until: not (l_pb_docker_upgrade_stop_result is failed)
- retries: 3
- delay: 30
- - name: Upgrade Docker
- package: name=docker{{ '-' + docker_version }} state=present
- register: result
- until: result is succeeded
- - include_tasks: restart.yml
- when: not skip_docker_restart | default(False) | bool
|