Search for containers within stopped containers.

During minor update pcs cluster is stopped during step 1.
Then we search for pcs managed containers at step 2.
But since pcs cluster is stopped, 'docker ps' won't report stopped
containers.
This change adds '--all' option to show all the containers.

Change-Id: If38a4f7e25d4d1f4679d9684ad2c0db8475d679b
Closes-Bug: #1737548
This commit is contained in:
Yurii Prokulevych 2017-12-11 14:28:44 +01:00
parent 3b626beca3
commit 09dcd7e26c
7 changed files with 7 additions and 7 deletions

View File

@ -244,7 +244,7 @@ outputs:
register: cinder_backup_image_id register: cinder_backup_image_id
- block: - block:
- name: Get a list of container using Cinder-Backup image - name: Get a list of container using Cinder-Backup image
shell: "docker ps -q -f 'ancestor={{cinder_backup_image_id.stdout}}'" shell: "docker ps -a -q -f 'ancestor={{cinder_backup_image_id.stdout}}'"
register: cinder_backup_containers_to_destroy register: cinder_backup_containers_to_destroy
# It will be recreated with the delpoy step. # It will be recreated with the delpoy step.
- name: Remove any container using the same Cinder-Backup image - name: Remove any container using the same Cinder-Backup image

View File

@ -265,7 +265,7 @@ outputs:
register: cinder_volume_image_id register: cinder_volume_image_id
- block: - block:
- name: Get a list of container using Cinder-Volume image - name: Get a list of container using Cinder-Volume image
shell: "docker ps -q -f 'ancestor={{cinder_volume_image_id.stdout}}'" shell: "docker ps -a -q -f 'ancestor={{cinder_volume_image_id.stdout}}'"
register: cinder_volume_containers_to_destroy register: cinder_volume_containers_to_destroy
# It will be recreated with the delpoy step. # It will be recreated with the delpoy step.
- name: Remove any container using the same Cinder-Volume image - name: Remove any container using the same Cinder-Volume image

View File

@ -323,7 +323,7 @@ outputs:
register: mariadb_image_id register: mariadb_image_id
- block: - block:
- name: Get a list of container using Mariadb image - name: Get a list of container using Mariadb image
shell: "docker ps -q -f 'ancestor={{mariadb_image_id.stdout}}'" shell: "docker ps -a -q -f 'ancestor={{mariadb_image_id.stdout}}'"
register: mariadb_containers_to_destroy register: mariadb_containers_to_destroy
# It will be recreated with the delpoy step. # It will be recreated with the delpoy step.
- name: Remove any container using the same Mariadb image - name: Remove any container using the same Mariadb image

View File

@ -224,7 +224,7 @@ outputs:
register: redis_image_id register: redis_image_id
- block: - block:
- name: Get a list of container using Redis image - name: Get a list of container using Redis image
shell: "docker ps -q -f 'ancestor={{redis_image_id.stdout}}'" shell: "docker ps -a -q -f 'ancestor={{redis_image_id.stdout}}'"
register: redis_containers_to_destroy register: redis_containers_to_destroy
# It will be recreated with the delpoy step. # It will be recreated with the delpoy step.
- name: Remove any container using the same Redis image - name: Remove any container using the same Redis image

View File

@ -263,7 +263,7 @@ outputs:
register: haproxy_image_id register: haproxy_image_id
- block: - block:
- name: Get a list of container using Haproxy image - name: Get a list of container using Haproxy image
shell: "docker ps -q -f 'ancestor={{haproxy_image_id.stdout}}'" shell: "docker ps -a -q -f 'ancestor={{haproxy_image_id.stdout}}'"
register: haproxy_containers_to_destroy register: haproxy_containers_to_destroy
# It will be recreated with the delpoy step. # It will be recreated with the delpoy step.
- name: Remove any container using the same Haproxy image - name: Remove any container using the same Haproxy image

View File

@ -183,7 +183,7 @@ outputs:
register: manila_share_image_id register: manila_share_image_id
- block: - block:
- name: Get a list of container using Manila-Share image - name: Get a list of container using Manila-Share image
shell: "docker ps -q -f 'ancestor={{manila_share_image_id.stdout}}'" shell: "docker ps -a -q -f 'ancestor={{manila_share_image_id.stdout}}'"
register: manila-share_containers_to_destroy register: manila-share_containers_to_destroy
# It will be recreated with the delpoy step. # It will be recreated with the delpoy step.
- name: Remove any container using the same Manila-Share image - name: Remove any container using the same Manila-Share image

View File

@ -261,7 +261,7 @@ outputs:
register: rabbitmq_image_id register: rabbitmq_image_id
- block: - block:
- name: Get a list of container using Rabbitmq image - name: Get a list of container using Rabbitmq image
shell: "docker ps -q -f 'ancestor={{rabbitmq_image_id.stdout}}'" shell: "docker ps -a -q -f 'ancestor={{rabbitmq_image_id.stdout}}'"
register: rabbitmq_containers_to_destroy register: rabbitmq_containers_to_destroy
# It will be recreated with the delpoy step. # It will be recreated with the delpoy step.
- name: Remove any container using the same Rabbitmq image - name: Remove any container using the same Rabbitmq image