diff --git a/docker/services/pacemaker/cinder-backup.yaml b/docker/services/pacemaker/cinder-backup.yaml index b906b53d7a..8ccd9aed97 100644 --- a/docker/services/pacemaker/cinder-backup.yaml +++ b/docker/services/pacemaker/cinder-backup.yaml @@ -253,14 +253,16 @@ outputs: register: cinder_backup_image_id - block: - name: Get a list of container using Cinder-Backup image - shell: "docker ps -a -q -f 'ancestor={{cinder_backup_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ cinder_backup_image_id.stdout_lines }}" register: cinder_backup_containers_to_destroy # It will be recreated with the deploy step. - name: Remove any container using the same Cinder-Backup image - shell: "docker rm -fv {{item}}" - with_items: "{{ cinder_backup_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ cinder_backup_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous Cinder-Backup images - shell: "docker rmi -f {{cinder_backup_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ cinder_backup_image_id.stdout_lines }}" when: - cinder_backup_image_id.stdout != '' - name: Pull latest Cinder-Backup images diff --git a/docker/services/pacemaker/cinder-volume.yaml b/docker/services/pacemaker/cinder-volume.yaml index fd6eb58227..9ad7f22995 100644 --- a/docker/services/pacemaker/cinder-volume.yaml +++ b/docker/services/pacemaker/cinder-volume.yaml @@ -218,14 +218,16 @@ outputs: register: cinder_volume_image_id - block: - name: Get a list of container using Cinder-Volume image - shell: "docker ps -a -q -f 'ancestor={{cinder_volume_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ cinder_volume_image_id.stdout_lines }}" register: cinder_volume_containers_to_destroy - # It will be recreated with the delpoy step. + # It will be recreated with the deploy step. - name: Remove any container using the same Cinder-Volume image - shell: "docker rm -fv {{item}}" - with_items: "{{ cinder_volume_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ cinder_volume_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous Cinder-Volume images - shell: "docker rmi -f {{cinder_volume_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ cinder_volume_image_id.stdout_lines }}" when: - cinder_volume_image_id.stdout != '' - name: Pull latest Cinder-Volume images diff --git a/docker/services/pacemaker/database/mysql.yaml b/docker/services/pacemaker/database/mysql.yaml index 53793c187d..4f796efc19 100644 --- a/docker/services/pacemaker/database/mysql.yaml +++ b/docker/services/pacemaker/database/mysql.yaml @@ -324,14 +324,16 @@ outputs: register: mariadb_image_id - block: - name: Get a list of container using Mariadb image - shell: "docker ps -a -q -f 'ancestor={{mariadb_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ mariadb_image_id.stdout_lines }}" register: mariadb_containers_to_destroy - # It will be recreated with the delpoy step. + # It will be recreated with the deploy step. - name: Remove any container using the same Mariadb image - shell: "docker rm -fv {{item}}" - with_items: "{{ mariadb_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ mariadb_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous Mariadb images - shell: "docker rmi -f {{mariadb_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ mariadb_image_id.stdout_lines }}" when: - mariadb_image_id.stdout != '' - name: Pull latest Mariadb images diff --git a/docker/services/pacemaker/database/redis.yaml b/docker/services/pacemaker/database/redis.yaml index 45b7bff245..4d3abd788f 100644 --- a/docker/services/pacemaker/database/redis.yaml +++ b/docker/services/pacemaker/database/redis.yaml @@ -304,14 +304,16 @@ outputs: register: redis_image_id - block: - name: Get a list of container using Redis image - shell: "docker ps -a -q -f 'ancestor={{redis_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ redis_image_id.stdout_lines }}" register: redis_containers_to_destroy - # It will be recreated with the delpoy step. + # It will be recreated with the deploy step. - name: Remove any container using the same Redis image - shell: "docker rm -fv {{item}}" - with_items: "{{ redis_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ redis_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous Redis images - shell: "docker rmi -f {{redis_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ redis_image_id.stdout_lines }}" when: - redis_image_id.stdout != '' - name: Pull latest Redis images diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml index 626a242f0e..6617cdfea5 100644 --- a/docker/services/pacemaker/haproxy.yaml +++ b/docker/services/pacemaker/haproxy.yaml @@ -379,14 +379,16 @@ outputs: register: haproxy_image_id - block: - name: Get a list of container using Haproxy image - shell: "docker ps -a -q -f 'ancestor={{haproxy_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ haproxy_image_id.stdout_lines }}" register: haproxy_containers_to_destroy - # It will be recreated with the delpoy step. + # It will be recreated with the deploy step. - name: Remove any container using the same Haproxy image - shell: "docker rm -fv {{item}}" - with_items: "{{ haproxy_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ haproxy_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous Haproxy images - shell: "docker rmi -f {{haproxy_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ haproxy_image_id.stdout_lines }}" when: - haproxy_image_id.stdout != '' - name: Pull latest Haproxy images diff --git a/docker/services/pacemaker/manila-share.yaml b/docker/services/pacemaker/manila-share.yaml index fef0827c85..158638d572 100644 --- a/docker/services/pacemaker/manila-share.yaml +++ b/docker/services/pacemaker/manila-share.yaml @@ -232,14 +232,16 @@ outputs: register: manila_share_image_id - block: - name: Get a list of container using Manila-Share image - shell: "docker ps -a -q -f 'ancestor={{manila_share_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ manila_share_image_id.stdout_lines }}" register: manila_share_containers_to_destroy - # It will be recreated with the delpoy step. + # It will be recreated with the deploy step. - name: Remove any container using the same Manila-Share image - shell: "docker rm -fv {{item}}" - with_items: "{{ manila_share_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ manila_share_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous Manila-Share images - shell: "docker rmi -f {{manila_share_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ manila_share_image_id.stdout_lines }}" when: - manila_share_image_id.stdout != '' - name: Pull latest Manila-Share images diff --git a/docker/services/pacemaker/ovn-dbs.yaml b/docker/services/pacemaker/ovn-dbs.yaml index db7116c0e4..5e7d09915b 100644 --- a/docker/services/pacemaker/ovn-dbs.yaml +++ b/docker/services/pacemaker/ovn-dbs.yaml @@ -225,14 +225,16 @@ outputs: register: ovn_dbs_image_id - block: - name: Get a list of container using ovn-dbs image - shell: "docker ps -a -q -f 'ancestor={{ovn_dbs_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ ovn_dbs_image_id.stdout_lines }}" register: ovn_dbs_containers_to_destroy # It will be recreated with the deploy step. - name: Remove any container using the same ovn-dbs image - shell: "docker rm -fv {{item}}" - with_items: "{{ ovn_dbs_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ ovn_dbs_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous ovn-dbs images - shell: "docker rmi -f {{ovn_dbs_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ ovn_dbs_image_id.stdout_lines }}" when: - ovn_dbs_image_id.stdout != '' - name: Pull latest ovn-dbs images diff --git a/docker/services/pacemaker/rabbitmq.yaml b/docker/services/pacemaker/rabbitmq.yaml index 79a67f1464..0e182509ee 100644 --- a/docker/services/pacemaker/rabbitmq.yaml +++ b/docker/services/pacemaker/rabbitmq.yaml @@ -276,14 +276,16 @@ outputs: register: rabbitmq_image_id - block: - name: Get a list of container using Rabbitmq image - shell: "docker ps -a -q -f 'ancestor={{rabbitmq_image_id.stdout}}'" + shell: "docker ps -a -q -f 'ancestor={{ item }}'" + with_items: "{{ rabbitmq_image_id.stdout_lines }}" register: rabbitmq_containers_to_destroy - # It will be recreated with the delpoy step. + # It will be recreated with the deploy step. - name: Remove any container using the same Rabbitmq image - shell: "docker rm -fv {{item}}" - with_items: "{{ rabbitmq_containers_to_destroy.stdout_lines }}" + shell: "docker rm -fv {{ item }}" + with_items: "{{ rabbitmq_containers_to_destroy.results | map(attribute='stdout_lines') | list | flatten }}" - name: Remove previous Rabbitmq images - shell: "docker rmi -f {{rabbitmq_image_id.stdout}}" + shell: "docker rmi -f {{ item }}" + with_items: "{{ rabbitmq_image_id.stdout_lines }}" when: - rabbitmq_image_id.stdout != '' - name: Pull latest Rabbitmq images