Fix cache update after initial apt_repository fail
If apt_repository fails to update the apt cache after updating the
configuration, retries don't register there was a change and so no
attempt is made to update the cache by the module on the second attempt.
This failure can result in a failure to install packages.
This change puts responsibility for updating the cache on the apt module
task, this means updating the cache will get retried on failure and no
longer fail silently.
The changes made include:
- the two apt_repository tasks have their update_cache parameter set to
no so it is clear where any update happens and there is no unnecessary
duplication of cache updates.
- the use of retries is removed given the tasks no longer need to make
use of the network.
- the apt_repository task result variables have been given unique names
to ensure that the cache is updated if only the galera repository is
added.
In addition, this cherry-pick separates out the cache update step from
the install task so that the update is not performed for every item.
Change-Id: I91b7929113f720bc3c55343c481096657376302f
Partial-bug: 1750656
(cherry picked from commit 7596eaa8898e774e4779417ac8c1fec38f634977)
Reviewed: https:/ /review. openstack. org/547063 /git.openstack. org/cgit/ openstack/ openstack- ansible- galera_ server/ commit/ ?id=ea7b8b253be e0c9bcee1a27a2f a4119bf1d70047
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit ea7b8b253bee0c9 bcee1a27a2fa411 9bf1d70047
Author: git-harry <email address hidden>
Date: Tue Feb 20 20:57:00 2018 +0000
Fix cache update after initial apt_repository fail
If apt_repository fails to update the apt cache after updating the
configuration, retries don't register there was a change and so no
attempt is made to update the cache by the module on the second attempt.
This failure can result in a failure to install packages.
This change puts responsibility for updating the cache on the apt module
task, this means updating the cache will get retried on failure and no
longer fail silently.
The changes made include:
- the two apt_repository tasks have their update_cache parameter set to
no so it is clear where any update happens and there is no unnecessary
duplication of cache updates.
- the use of retries is removed given the tasks no longer need to make
use of the network.
- the apt_repository task result variables have been given unique names
to ensure that the cache is updated if only the galera repository is
added.
In addition, this cherry-pick separates out the cache update step from
the install task so that the update is not performed for every item.
Change-Id: I91b7929113f720 bc3c55343c48109 6657376302f e4779417ac8c1fe c38f634977)
Partial-bug: 1750656
(cherry picked from commit 7596eaa8898e774