With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.
With that we also update metdata to reflect current state.
Change-Id: I13935aa1ae19449184053fc40cc64b09ed1ba9ef
Since ansible 2.8 it's possible to provide policy_rc_d attribute to the
apt module in order to avoid service restart on installation/upgrade
Change-Id: Ida1ce1b767497c792fbb7bcdb934ba5e282041b1
Keystone role was never migrated to usage of haproxy-endpoints role
and included task was used instead the whole time.
With that to reduce complexity and to have unified approach, all mention
of the role and handler are removed from the code.
Change-Id: I2a83e31a9de998cd10dd95fc0cffc1ad68061da5
There is no offical MariaDB build for bullseye so we must use
the version from the operating system repo.
Change-Id: I46f9d73ac27928edf4236fd797afde6e5ea9427e
When running galera_server role with galera_upgrade=true
it uninstalls mariadb and installs again. In some distros, like CentOS,
mariadb don't start automatically after installation, so upgrade fails.
This patch adds handler on packsage installation, which will be
triggered when package state is changed.
Change-Id: I23811cfaf23007c5da1860e78397be380d67403b
Related-bug: 1628720
We're currently deploying 10.2.17 which is quite old and we seem
to be having issues in the gate with some database sync's causing
MariaDB to crash, as well as personal experience with similar
crashes around Cinder database syncs
In addition, this change implements the usage of mariabackup for
SST transfers which eliminates the need for the Percona repos.
The compression is no longer recommended by upstream now, therefore,
we remove it.
Change-Id: I59a0e225205be43b5bfc76c4bc3381b6e9c54cfd
To ensure that we have a consistent implementation
between the galera_client and galera_server roles,
we change the galera_server role to match galera_client
as was done in I520ccbadf3320b0d07fc83e3dbec9ea2bd16ec83
This updates it to a mechanism which will be easier to
maintain.
Change-Id: I7ac1a5e3a05aa3d0b4fae86c4a325ef147a9a528
===
[DEPRECATION WARNING]: Using tests as filters is deprecated.
Instead of using `result|search` use `result is search`. This
feature will be removed in version 2.9.
===
Change-Id: Ia837837e76bb25cf6e5d48e4612128fc58668e62
In https://review.openstack.org/534819 we introduced the removal
of conflicting packages from the targeted host, but then we deleted
the list for RedHat in https://review.openstack.org/578844 because
yum kept removing and re-adding the same packages.
In https://review.openstack.org/603205 we solve the issue properly
given that yum is case-insensitive, and the root cause of the repeat
remove/install.
As such, in this patch, we restore the removal of conflicting
packages for RedHat in a different way. Each of the package removal
tasks are moved into the tasks specific to each package manager so
that each can be handled differently.
Change-Id: I70fbfa6eff8796713c6bec32319382273f8281f8
Related-Bug: #1762421
Related-Bug: #1742206
With the more recent versions of ansible, we should now use
"is" instead of the "|" sign for the tests.
This should fix it.
Change-Id: I239a472c1d76f1cc00666280a93b73ecd84ba3d9
We don't need python cryptography bindings in order to deploy a Galera
server therefore drop it from our dependencies. It also is no longer
used inside OpenStack world for lack of security.
Also, we make remote network hits to get the GPG keys which are quite
unreliable so let's store them inside the role and use them.
Change-Id: I9443f10e8c803599cbebfc2a53cb9c432bfa60d1
When the repositories change, the apt cache needs updating to bring
in the new indexes. Recently this has failed quite often. In the
hope that we can get more diagnostic information, and in order to
make the tasks a litte easier to read, we split them into two.
Change-Id: I4b1bb0d3c318a1f07b4a1d055faed65691565320
In https://review.openstack.org/535252 the installation
process for the role was simplified, but an unintentional
side-effect was to removed the previously included support
for installing the extra percona packages when installing
on the ppc64le platform.
This patch re-introduces that ability, but scopes it to
only execute on that hardware platform, and only for Ubuntu.
The download is, by default, facilitated through the deploy
node (rather than the target nodes) so that the download
is done once, then pushed to the targets. This can be
adjusted with the right parameters to download from the
targets instead.
Also, in https://review.openstack.org/543888 adjustments
were made to disable compression/qpress on architectures
other than x86_64, and to fail the role execution if it
was enabled on any other architecture. This has been
corrected to ensure that compression is enabled by default
for ppc64le on Ubuntu, and enabled by default for x86_64,
but disabled by default for all other combinations. The
fail task is adjusted appropriately and moved to the main
task file so that it executes and fails out before any
changes are made.
Change-Id: I850a37b465a427a827e357111942973457fafa0d
The 'use_percona_upstream' variable had quite different and conflicting
meanings in the tasks. It's used to either denote that the upstream
packages will be used directly or that the upstream repositories will
be configured on the hosts and then use the packages from these
repositories. However, the packages in both cases are the same so the
variable was pointless in this form. The variable was meant to be used
to select between upstream and downstream repositories for the Percona
packages. Moreover, upstream does not provide packages for SUSE so we
have to exit the deployment if that variable is set.
Partial-Bug: #1654004
Change-Id: I18853707c29955186da5a1f4d6e80bc3012c04f9
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.
Change-Id: I91b7929113f720bc3c55343c481096657376302f
Partial-bug: 1750656
The galera server role has quite a bit going on within it and because of
recent improvements in Ansible we can make better use of tasks, blocks,
facts, local facts, and organization. This change tunes the role up
following some of our better/more modern patterns allowing the role to
not only be more efficient but also easier to understand and improves
the roles idempotency.
Change-Id: If189a8192f22aafb168587361ca8e6903c918697
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
Instead of allowing the first task to fail, then
using the fallback - use block/rescue to achieve
the same, but totally skip the second task if the
first succeeds.
Change-Id: Ida644fee4f9842a45bf273db379b00df12bec695
The role uses the 'use_percona_upstream' variable to determine if
specific external packages are going to be used instead of the distro or
upstream ones. The {qpress,percona}_package_path variables only make sense
if we are going to use such external packages so we convert their static
declaration into a 'set_fact' task. This also allows distributions to
override the default package list with an empty list if they do not plan
to use local percona packages.
Change-Id: Icb65f6c8c1654e24f73e1e5310516cd9b3568aad
When the set_fact module is used with the ternary filter the evaluated
condition must be surrounded in parentheses, otherwise the fact will
always be set to False.
While other uses of ternary within this role don't seem to be effected,
update them also for consistency and readability.
Change-Id: I4809ded8b6fe738f8fa700434739ee0b1f6d3af1
Installing all packages in one step speeds up the playbook run and is
being used in other roles already.
Change-Id: Iadd07d7979772a49e5f55f612fd95a099924638d
If the deployer decides to override the complete apt repository
git, it would be best to have the possibility to NOT define a
filename, this way it would be the same behavior as in N.
This also allows a combined backport of
https://review.openstack.org/#/c/417362/
to fix bug 1653947 cleanly in Newton.
Change-Id: I00b924275cd9350a93b48f4d886919b597392049
If we filtered this role by running only on tags config/install,
the task(s) changed here wouldn't be properly targeted.
Under ubuntu the galera server would run by default if only doing the
install tag, where it should stay disabled.
Change-Id: Ic23fad68b9ee383559695ab73d6447735f445f51
If the ``use_percona_upstream`` value is changed from True to False,
don't remove the existing repository. This is also the source of a bug
in Mitaka: We were installing the repo by default and installed the
percona-xtrabackup tool with a deb file. If another playbook/role
installed percona-xtrabackup, it would override (and probably upgrade)
the deb installed version, which is undesired.
Change-Id: I2ccc2904d0d4244dc0792411b49763cc3f7e2e22
Closes-Bug: 1653947
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
Apt cannot have 2 mirrors with the same content in 2 different files.
If a deployer has an apt mirror with mariadb (and others), the deployer
still need to add a repository, but will also need to define the
filename used, in order to avoid clashes.
This commit makes possible to decide the filename for the repo.
Change-Id: I047bdaf58a4057a96103f6d56c2f811886b1b625
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
Update repos and packages to install the server for MariaDB 10.1, the
current stable release.
Several improvements have been made to improve the upgrade process and
an upgrade from 10.0 has been included in the test playbooks.
Make use of the yum_repository module for installing on yum based
systems and give the apt repository files consistent names, 'MariaDB'
and 'Percona' for easier maintenance and handling of upgrades going
forward.
Depends-On: I8939703f26e5d8adc393b984266f4cad7a6e0b4c
Change-Id: Ib6409f1fcf4a664b65dbe01372a19509d02d70a4
This change removes the use of 'ignore_errors: true' because it causes deployers
to see red output and a stacktrace, which traditionally means something is broken,
even when the failure is known to have a fall back option or be intentional. This
conversion will provide a generally cleaner interface.
It should be noted that the 'failed' filter will still function normally. Tasks
with the 'failed_when: false' option will still be marked as 'failed' in any
registered variable. This change simply makes the output look cleaner.
Change-Id: I2a40fa9a0da45602a76f2d56611971fcf4063512
Closes-Bug: #1633438
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
In order to make it easier to differentiate between the lists of
python packages, distribution packages, downloaded packages,
package pins and other similar variables the variable names are
being changed to ensure that they have a more explicit suffix
that defines the purpose and makes the naming more consistent.
This is to facilitate a lookup plugin which will be able to look
up all the package lists and present them as a consolidated piece
of data which may be used for artifact preparation.
Change-Id: Iba040bf8da6ec0552fcf7d10022094dc57d312bc
The current method of installing the distribution packages required is
set in the tasks and cannot be changed by a deployer.
Currently the apt task always installs the latest package. This results
in unexpected binary changes when a deployer may simply be trying to
execute a configuration change.
This patch adds the ability for a deployer to change the desired state
so that the results are predictable.
Change-Id: Ifefa11da81b59084c238a8264fec9f0018dfe23d
Updates the multi-distro framework to add CentOS7 support.
Depends-On: Ieadcdd70e9b8271aee3880896255a5037f56567e
Change-Id: I7e889ea4653a6972ea7f8208416fc1fc3db45e5c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit implements support for Ubuntu 16.04 Xenial. Changes
include renaming several variables from galera_* to percona_* for
clarity. The reason for this change is that 16.04 will be using
distribution provided packages for percona-xtrabackup.
Mariadb 10.0 packages are available for Ubuntu 16.04, so those
packages and installations procedures will remain unchanged.
Depends-On: Iab5485529cf14933fd7f37430d234a5c41185c18
Change-Id: I4baeb2eddf137619ffedba2f9efd61b7bd142f92
* The default apt packages have been moved into a var file
that is only loaded when the detected OS is matched.
* The Install task file has had the apt specific tasks moved
into a named install task file.
Change-Id: I145f6ea0249d577a99c771704125736f3fccef4f
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>