Support HA container tagging with podman

Use container_cli instead of hardcoding docker. It'll allow us to use
Podman on the overcloud when Pacemaker is enabled.

blueprint podman-support
Co-Authored-By: Dan Prince <dprince@redhat.com>
Change-Id: Ibd2d5cbbf439177419b3d0780c5d1434a4f77605
This commit is contained in:
Dan Prince 2018-11-01 14:41:43 -04:00 committed by Cédric Jeanneret
parent a16cce6c4f
commit 5480200cba
10 changed files with 50 additions and 50 deletions

View File

@ -254,18 +254,18 @@ outputs:
docker_image: {get_param: DockerCinderBackupImage}
docker_image_latest: *cinder_backup_image_pcmklatest
- name: Get previous Cinder-Backup image id
shell: "docker images | awk '/cinder-backup.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/cinder-backup.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} ps -a -q -f 'ancestor={{cinder_backup_image_id.stdout}}'"
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}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ cinder_backup_containers_to_destroy.stdout_lines }}"
- name: Remove previous Cinder-Backup images
shell: "docker rmi -f {{cinder_backup_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{cinder_backup_image_id.stdout}}"
when:
- cinder_backup_image_id.stdout != ''
- name: Pull latest Cinder-Backup images
@ -297,7 +297,7 @@ outputs:
when: cinder_backup_containerized|bool
block:
- name: Get cinder_backup image id currently used by pacemaker
shell: "docker images | awk '/cinder-backup.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/cinder-backup.* pcmklatest/{print $3}' | uniq"
register: cinder_backup_current_pcmklatest_id
- name: Temporarily tag the current cinder_backup image id with the upgraded image name
when: cinder_backup_current_pcmklatest_id.stdout != ''

View File

@ -221,18 +221,18 @@ outputs:
docker_image: {get_param: DockerCinderVolumeImage}
docker_image_latest: *cinder_volume_image_pcmklatest
- name: Get previous Cinder-Volume image id
shell: "docker images | awk '/cinder-volume.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/cinder-volume.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ cinder_volume_containers_to_destroy.stdout_lines }}"
- name: Remove previous Cinder-Volume images
shell: "docker rmi -f {{cinder_volume_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{cinder_volume_image_id.stdout}}"
when:
- cinder_volume_image_id.stdout != ''
- name: Pull latest Cinder-Volume images
@ -264,7 +264,7 @@ outputs:
when: cinder_volume_containerized|bool
block:
- name: Get cinder_volume image id currently used by pacemaker
shell: "docker images | awk '/cinder-volume.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/cinder-volume.* pcmklatest/{print $3}' | uniq"
register: cinder_volume_current_pcmklatest_id
- name: Temporarily tag the current cinder_volume image id with the upgraded image name
import_role:

View File

@ -314,18 +314,18 @@ outputs:
docker_image: {get_param: DockerMysqlImage}
docker_image_latest: *mysql_image_pcmklatest
- name: Get previous Mariadb image id
shell: "docker images | awk '/mariadb.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/mariadb.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ mariadb_containers_to_destroy.stdout_lines }}"
- name: Remove previous Mariadb images
shell: "docker rmi -f {{mariadb_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{mariadb_image_id.stdout}}"
when:
- mariadb_image_id.stdout != ''
- name: Pull latest Mariadb images
@ -361,7 +361,7 @@ outputs:
when: mysql_containerized|bool
block:
- name: Get galera image id currently used by pacemaker
shell: "docker images | awk '/mariadb.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/mariadb.* pcmklatest/{print $3}' | uniq"
register: galera_current_pcmklatest_id
- name: Temporarily tag the current galera image id with the upgraded image name
import_role:

View File

@ -293,18 +293,18 @@ outputs:
docker_image: {get_param: DockerRedisImage}
docker_image_latest: *redis_image_pcmklatest
- name: Get previous Redis image id
shell: "docker images | awk '/redis.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/redis.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ redis_containers_to_destroy.stdout_lines }}"
- name: Remove previous Redis images
shell: "docker rmi -f {{redis_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{redis_image_id.stdout}}"
when:
- redis_image_id.stdout != ''
- name: Pull latest Redis images
@ -340,7 +340,7 @@ outputs:
when: redis_containerized|bool
block:
- name: Get redis image id currently used by pacemaker
shell: "docker images | awk '/redis.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/redis.* pcmklatest/{print $3}' | uniq"
register: redis_current_pcmklatest_id
- name: Temporarily tag the current redis image id with the upgraded image name
import_role:

View File

@ -350,22 +350,22 @@ outputs:
docker_image: {get_param: DockerHAProxyImage}
docker_image_latest: *haproxy_image_pcmklatest
- name: Get previous Haproxy image id
shell: "docker images | awk '/haproxy.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/haproxy.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ haproxy_containers_to_destroy.stdout_lines }}"
- name: Remove previous Haproxy images
shell: "docker rmi -f {{haproxy_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{haproxy_image_id.stdout}}"
when:
- haproxy_image_id.stdout != ''
- name: Pull latest Haproxy images
command: "docker pull {{docker_image}}"
command: "{{container_cli}} pull {{docker_image}}"
- name: Retag pcmklatest to latest Haproxy image
import_role:
name: tripleo-container-tag
@ -387,7 +387,7 @@ outputs:
when: haproxy_containerized|bool
block:
- name: Get haproxy image id currently used by pacemaker
shell: "docker images | awk '/haproxy.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/haproxy.* pcmklatest/{print $3}' | uniq"
register: haproxy_current_pcmklatest_id
- name: Temporarily tag the current haproxy image id with the upgraded image name
import_role:

View File

@ -221,18 +221,18 @@ outputs:
docker_image: {get_param: DockerManilaShareImage}
docker_image_latest: *manila_share_image_pcmklatest
- name: Get previous Manila-Share image id
shell: "docker images | awk '/manila-share.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/manila-share.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ manila_share_containers_to_destroy.stdout_lines }}"
- name: Remove previous Manila-Share images
shell: "docker rmi -f {{manila_share_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{manila_share_image_id.stdout}}"
when:
- manila_share_image_id.stdout != ''
- name: Pull latest Manila-Share images
@ -264,7 +264,7 @@ outputs:
when: manila_share_containerized|bool
block:
- name: Get Manila-Share image id currently used by pacemaker
shell: "docker images | awk '/manila-share.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/manila-share.* pcmklatest/{print $3}' | uniq"
register: manila_share_current_pcmklatest_id
- name: Temporarily tag the current Manila-Share image id with the upgraded image name
import_role:

View File

@ -263,18 +263,18 @@ outputs:
docker_image: {get_param: DockerRabbitmqImage}
docker_image_latest: *rabbitmq_image_pcmklatest
- name: Get previous Rabbitmq image id
shell: "docker images | awk '/rabbitmq.* pcmklatest/{print $3}'"
shell: "{{container_cli}} images | awk '/rabbitmq.* pcmklatest/{print $3}'"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ rabbitmq_containers_to_destroy.stdout_lines }}"
- name: Remove previous Rabbitmq images
shell: "docker rmi -f {{rabbitmq_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{rabbitmq_image_id.stdout}}"
when:
- rabbitmq_image_id.stdout != ''
- name: Pull latest Rabbitmq images

View File

@ -217,18 +217,18 @@ outputs:
- ovn_dbs_containerized|bool
block: &ovn_dbs_fetch_retag_container_tasks
- name: Get previous ovn-dbs image id
shell: "docker images | awk '/ovn.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/ovn.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} ps -a -q -f 'ancestor={{ovn_dbs_image_id.stdout}}'"
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}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ ovn_dbs_containers_to_destroy.stdout_lines }}"
- name: Remove previous ovn-dbs images
shell: "docker rmi -f {{ovn_dbs_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{ovn_dbs_image_id.stdout}}"
when:
- ovn_dbs_image_id.stdout != ''
- name: Pull latest ovn-dbs images
@ -287,7 +287,7 @@ outputs:
- ovn_dbs_containerized|bool
block:
- name: Get ovn-dbs image id currently used by pacemaker
shell: "docker images | awk '/ovn.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/ovn.* pcmklatest/{print $3}' | uniq"
register: ovn_dbs_current_pcmklatest_id
- name: Temporarily tag the current ovn-dbs pcmklatest image id with the upgraded image name
import_role:

View File

@ -262,18 +262,18 @@ outputs:
docker_image: {get_param: DockerRabbitmqImage}
docker_image_latest: *rabbitmq_image_pcmklatest
- name: Get previous Rabbitmq image id
shell: "docker images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ rabbitmq_containers_to_destroy.stdout_lines }}"
- name: Remove previous Rabbitmq images
shell: "docker rmi -f {{rabbitmq_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{rabbitmq_image_id.stdout}}"
when:
- rabbitmq_image_id.stdout != ''
- name: Pull latest Rabbitmq images
@ -340,7 +340,7 @@ outputs:
- rabbit_containerized|bool
block:
- name: Get rabbitmq image id currently used by pacemaker
shell: "docker images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
register: rabbitmq_current_pcmklatest_id
- name: Temporarily tag the current rabbitmq image id with the upgraded image name
import_role:

View File

@ -263,18 +263,18 @@ outputs:
docker_image: {get_param: DockerRabbitmqImage}
docker_image_latest: *rabbitmq_image_pcmklatest
- name: Get previous Rabbitmq image id
shell: "docker images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
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: "{{container_cli}} 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
shell: "docker rm -fv {{item}}"
shell: "{{container_cli}} rm -fv {{item}}"
with_items: "{{ rabbitmq_containers_to_destroy.stdout_lines }}"
- name: Remove previous Rabbitmq images
shell: "docker rmi -f {{rabbitmq_image_id.stdout}}"
shell: "{{container_cli}} rmi -f {{rabbitmq_image_id.stdout}}"
when:
- rabbitmq_image_id.stdout != ''
- name: Pull latest Rabbitmq images
@ -341,7 +341,7 @@ outputs:
- rabbit_containerized|bool
block:
- name: Get rabbitmq image id currently used by pacemaker
shell: "docker images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
shell: "{{container_cli}} images | awk '/rabbitmq.* pcmklatest/{print $3}' | uniq"
register: rabbitmq_current_pcmklatest_id
- name: Temporarily tag the current rabbitmq image id with the upgraded image name
import_role: