tripleo-ansible/tripleo_ansible/roles/tripleo_bootstrap/tasks
Cédric Jeanneret cca76e8dfe Ensure bootstrap packages are correctly installed
It may happen a package fails to properly install (especially for
openstack-selinux). Unfortunately, in such cases rpm will just output
some warning lost in the output, and will still exit with a success code
(0).

This patch allows to leverage the "--verify" option of RPM. If a package
spec file has a %verifyscript scriptlet, it will be called, and do
whatever is described in it.
In openstack-selinux case, it will ensure everything is actually
installed without issue[1].
If a package doesn't have the %verifyscript, rpm will just exit 0
without any error nor warning.

Note:
the failed_when condition allows to:
- protect against missing package (openvswitch)
- ensure we're actually failing on the %verifyscript
The second part is useful when we don't get the doc for package -
apparently, this is the case for python3-pyyaml, at least in CI
(molecule).

[1] https://review.rdoproject.org/r/c/openstack/openstack-selinux-distgit/+/43578

Change-Id: Iec1e79c9c1cbb6b7e5e7b768d425aab8270c1d89
(cherry picked from commit 2f29bfb7e0)
2022-07-08 10:13:42 +00:00
..
main.yml Make bootstrap tasks more modular 2022-06-22 13:17:49 +00:00
packages.yml Ensure bootstrap packages are correctly installed 2022-07-08 10:13:42 +00:00