Add transaction cleanup to cent prep

Because we use a transation when prep'ing the cent image we need to
cleanup the transactions upon completion. This change is looking to
solve the issue where ansible will fail package install reporting

> "The following packages have pending transactions"

This seems to be happening totally randomly though is always early in
the deployment process. After spot checking a few instances I
noticed the command found several stale transactions and cleaned them
up. Example from within a contianer after a failed build.

> http://paste.openstack.org/show/664394/

Since incorporating this change I've not seen the issue.

Change-Id: I618c767c6daace11cf12d810d7bef47eec15f240
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-02-06 20:39:37 -06:00
parent 2ebddb655d
commit 9681e7564e
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
1 changed files with 1 additions and 0 deletions

View File

@ -74,6 +74,7 @@ lxc_cache_map:
echo "install {{ lxc_cache_distro_packages | join(' ') }}" >> /tmp/package-transaction.txt
echo "run" >> /tmp/package-transaction.txt
$RHT_PKG_MGR -y shell /tmp/package-transaction.txt
yum-complete-transaction --cleanup-only
rm -f /tmp/package-transaction.txt
rm -f /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python