From 09dcd7e26c45edeefc1463a2885f94882433589e Mon Sep 17 00:00:00 2001 From: Yurii Prokulevych Date: Mon, 11 Dec 2017 14:28:44 +0100 Subject: [PATCH] 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 --- docker/services/pacemaker/cinder-backup.yaml | 2 +- docker/services/pacemaker/cinder-volume.yaml | 2 +- docker/services/pacemaker/database/mysql.yaml | 2 +- docker/services/pacemaker/database/redis.yaml | 2 +- docker/services/pacemaker/haproxy.yaml | 2 +- docker/services/pacemaker/manila-share.yaml | 2 +- docker/services/pacemaker/rabbitmq.yaml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/services/pacemaker/cinder-backup.yaml b/docker/services/pacemaker/cinder-backup.yaml index b7caa17fdf..40df9c5a4a 100644 --- a/docker/services/pacemaker/cinder-backup.yaml +++ b/docker/services/pacemaker/cinder-backup.yaml @@ -244,7 +244,7 @@ outputs: register: cinder_backup_image_id - block: - 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 # It will be recreated with the delpoy step. - name: Remove any container using the same Cinder-Backup image diff --git a/docker/services/pacemaker/cinder-volume.yaml b/docker/services/pacemaker/cinder-volume.yaml index 68c1f7b995..0f2c5e0133 100644 --- a/docker/services/pacemaker/cinder-volume.yaml +++ b/docker/services/pacemaker/cinder-volume.yaml @@ -265,7 +265,7 @@ outputs: register: cinder_volume_image_id - block: - 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 # It will be recreated with the delpoy step. - name: Remove any container using the same Cinder-Volume image diff --git a/docker/services/pacemaker/database/mysql.yaml b/docker/services/pacemaker/database/mysql.yaml index 0b03bd9baf..a43c8a0deb 100644 --- a/docker/services/pacemaker/database/mysql.yaml +++ b/docker/services/pacemaker/database/mysql.yaml @@ -323,7 +323,7 @@ outputs: register: mariadb_image_id - block: - 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 # It will be recreated with the delpoy step. - name: Remove any container using the same Mariadb image diff --git a/docker/services/pacemaker/database/redis.yaml b/docker/services/pacemaker/database/redis.yaml index 33305f2a3e..8ce4013f6e 100644 --- a/docker/services/pacemaker/database/redis.yaml +++ b/docker/services/pacemaker/database/redis.yaml @@ -224,7 +224,7 @@ outputs: register: redis_image_id - block: - 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 # It will be recreated with the delpoy step. - name: Remove any container using the same Redis image diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml index ad88aec506..12862565ab 100644 --- a/docker/services/pacemaker/haproxy.yaml +++ b/docker/services/pacemaker/haproxy.yaml @@ -263,7 +263,7 @@ outputs: register: haproxy_image_id - block: - 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 # It will be recreated with the delpoy step. - name: Remove any container using the same Haproxy image diff --git a/docker/services/pacemaker/manila-share.yaml b/docker/services/pacemaker/manila-share.yaml index 1be66a3387..ed14ac027f 100644 --- a/docker/services/pacemaker/manila-share.yaml +++ b/docker/services/pacemaker/manila-share.yaml @@ -183,7 +183,7 @@ outputs: register: manila_share_image_id - block: - 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 # It will be recreated with the delpoy step. - name: Remove any container using the same Manila-Share image diff --git a/docker/services/pacemaker/rabbitmq.yaml b/docker/services/pacemaker/rabbitmq.yaml index 05e320ecfe..81ec99f4b1 100644 --- a/docker/services/pacemaker/rabbitmq.yaml +++ b/docker/services/pacemaker/rabbitmq.yaml @@ -261,7 +261,7 @@ outputs: register: rabbitmq_image_id - block: - 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 # It will be recreated with the delpoy step. - name: Remove any container using the same Rabbitmq image