docker-rm: check if rpm dependency is actually installed
If the deployment wasn't deployed under Docker, python2-docker package
is missing. Therefore, during the upgrade we don't want to try to remove
the containers under Docker, since they don't exist anyway.
python2-docker is needed by Ansible to remove the containers, so let's
make sure the package is installed, which is the case when the
deployment was under Docker.
If the rpm doesn't exist, we'll skip the tasks and don't try to remove
the containers.
The main case where docker-rm is useful is when upgrading on centos7
from rocky to stein, since we clear containers running in Docker during
the upgrade, so they run on Podman.
In reality, the future platform won't have Docker installed, so this
role will become useless and we'll probably deprecate it.
Closes-Bug: #1824301
Change-Id: Ic5036ffa756775e3806e18b09e034af2290bfb56
(cherry picked from commit e368e15226b18d6f75b0ffaca424ce4cb574b2a4)
Reviewed: https:/ /review. opendev. org/655511 /git.openstack. org/cgit/ openstack/ tripleo- common/ commit/ ?id=f19863f332c a1e42c1a2046221 2c0a809d59241d
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit f19863f332ca1e4 2c1a20462212c0a 809d59241d
Author: Emilien Macchi <email address hidden>
Date: Thu Apr 11 09:57:00 2019 -0400
docker-rm: check if rpm dependency is actually installed
If the deployment wasn't deployed under Docker, python2-docker package
is missing. Therefore, during the upgrade we don't want to try to remove
the containers under Docker, since they don't exist anyway.
python2-docker is needed by Ansible to remove the containers, so let's
make sure the package is installed, which is the case when the
deployment was under Docker.
If the rpm doesn't exist, we'll skip the tasks and don't try to remove
the containers.
The main case where docker-rm is useful is when upgrading on centos7
from rocky to stein, since we clear containers running in Docker during
the upgrade, so they run on Podman.
In reality, the future platform won't have Docker installed, so this
role will become useless and we'll probably deprecate it.
Closes-Bug: #1824301 e3806e18b09e034 af2290bfb56 f75b0ffaca424ce 4cb574b2a4)
Change-Id: Ic5036ffa756775
(cherry picked from commit e368e15226b18d6