Commit Graph

41 Commits

Author SHA1 Message Date
Jonathan Rosser 28ac2fc7ee Bump galera version to 10.11.5
The repo for this point release includes packages for debian bookworm.

Change-Id: Ifeb558d92ff1a153ecd523f7f2897e143a66933c
2023-10-17 11:08:05 +00:00
Dmitriy Rabotyagov 91f578f2c0 Fix linters issue and metadata
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
2023-08-09 14:42:56 +00:00
Dmitriy Rabotyagov c6218267c6 Use policy_rc_d attribute instead of copy
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
2022-09-26 13:28:32 +02:00
Dmitriy Rabotyagov c9da7d6975 Remove mention of haproxy-endpoints role
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
2022-06-14 19:07:55 +02:00
Jonathan Rosser c2e17ae47f Add support for Debian Bullseye
There is no offical MariaDB build for bullseye so we must use
the version from the operating system repo.

Change-Id: I46f9d73ac27928edf4236fd797afde6e5ea9427e
2021-05-13 16:06:11 +00:00
Jonathan Rosser a7a396dbb8 Fix linter errors
Change-Id: Iceda4b23bf5347a7de9817d212ca8db8f2befc10
2020-10-02 18:00:25 +03:00
Jonathan Rosser 49b95ebcb7 Combine galera client role into galera_server
Depends-On: https://review.opendev.org/725902
Depends-On: https://review.opendev.org/728434
Change-Id: I02dc06d61006bb71a417a1470343e9c9c77d7935
2020-05-22 15:13:20 +03:00
Dmitriy Rabotyagov efc965f00f Restart mysql when package is installed
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
2019-11-05 18:31:53 +02:00
Mohammed Naser 94640cd215 Bump version and use mariabackup
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
2019-03-19 17:12:15 -04:00
Zuul 1d84ae7ae0 Merge "Normalise in-repo GPG key implementation" 2018-12-18 14:44:28 +00:00
Jesse Pretorius c2b73bff52 Normalise in-repo GPG key implementation
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
2018-12-18 12:41:15 +00:00
Jonathan Rosser 0f23dc604a Fix ansible deprecation warnings
===
[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
2018-12-03 17:28:43 +00:00
Jesse Pretorius 72f402d3e9 Revisit conflicting package removal
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
2018-09-18 04:00:11 +01:00
kaiokassiano 1cea6fca84 Remove the unnecessary space
Change-Id: Id70a5d6c9a6fbd8733a211ab9f6963d1f672a78a
2018-07-30 12:29:07 -03:00
Jean-Philippe Evrard 6191d3afcb Fix usage of "|" for tests
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
2018-07-12 17:01:05 +02:00
Mohammed Naser c41b80cee9 Remove python-crypto and use in-repo GPG keys
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
2018-06-21 17:06:03 -04:00
Jesse Pretorius d99a5aee23 Split the apt cache update when repos change from the install task
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
2018-04-27 10:49:12 +01:00
Frank-ZhangXin 3665575c52 Add no_log to prevent leaking
Current galera install leaks sql passwords in standard output, patching
it with no_log.

Change-Id: Ia170e4f25e35984e68b4cd47c3d964a034236d11
2018-03-27 13:43:58 -05:00
Jesse Pretorius 1075fe411a Restore support for percona packages when using ppc64le
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
2018-02-23 16:48:15 +00:00
Markos Chandras dbbcb56a62 tasks: Fix use_percona_upstream variable usage
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
2018-02-22 15:36:12 +00:00
git-harry 7596eaa889 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.

Change-Id: I91b7929113f720bc3c55343c481096657376302f
Partial-bug: 1750656
2018-02-21 10:10:32 +00:00
Kevin Carter ca054bd8f7 Tune-up the galera role for efficiency
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>
2017-11-29 01:59:52 +00:00
Jesse Pretorius 3ebde68b53 Use block/rescue for error handling
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
2017-08-11 08:07:43 +00:00
Major Hayden 475d2d8ca2 Pass packages as a list
This patch passes packages a list to the package module for
a performance boost.

Change-Id: Ia531571bb59e00335a942fd6627451f6bba51b2e
2017-08-04 15:45:57 +00:00
Markos Chandras 22a87ddf74 vars: main: Split percona packages from the galera server ones.
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
2017-06-14 15:31:43 +00:00
Jimmy McCrory 2f68deee89 Fix fact set using ternary filter
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
2017-02-28 10:36:05 -08:00
Major Hayden 777641e056 Install packages in one step
Installing all packages in one step speeds up the playbook run and is
being used in other roles already.

Change-Id: Iadd07d7979772a49e5f55f612fd95a099924638d
2017-02-22 19:20:49 +00:00
Jean-Philippe Evrard 323bfc8a19 Allow fallback to Newton default filename
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
2017-01-09 08:21:55 +00:00
Jenkins 2271abc26e Merge "Remove percona repo if not used" 2017-01-06 21:32:53 +00:00
Jean-Philippe Evrard 2861c4df36 Bring consistency to tags
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
2017-01-06 13:51:06 +00:00
Jean-Philippe Evrard 2aa7f1ca8a Remove percona repo if not used
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>
2017-01-06 12:10:11 +00:00
Jean-Philippe Evrard 3d1ecb7aa2 Allow override of the repo filename
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>
2017-01-04 09:17:57 +00:00
Jimmy McCrory fdaf169e1e Install MariaDB 10.1 server
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
2016-11-30 10:48:30 -08:00
Jean-Philippe Evrard 8f06602a04 Remove ansible<2.2 apt cache hack
Now ansible apt module correctly behaves, so it's time
to deprecate these cruft tasks for apt.

Change-Id: Idea4d6beda9b0c62dc15de9f6d8dac7f12f050f9
2016-11-04 15:46:40 +00:00
Kevin Carter 5038acc390 Remove 'ignore_errors: true' in favor of 'failed_when: false'
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>
2016-10-16 14:45:00 +00:00
Jesse Pretorius 3df31ce349 Rename package lists (and related vars) appropriately
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
2016-08-26 15:47:41 +01:00
Jesse Pretorius 54ca3be6d4 Add ability to change apt/yum package state
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
2016-08-02 07:49:07 +00:00
Kevin Carter 5b23837dd0
Add CentOS7 support to Galera Server
Updates the multi-distro framework to add CentOS7 support.

Depends-On: Ieadcdd70e9b8271aee3880896255a5037f56567e
Change-Id: I7e889ea4653a6972ea7f8208416fc1fc3db45e5c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-05-23 13:04:38 -05:00
Michael Gugino 5136160186 Implement Xenial Support
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
2016-05-19 16:38:40 -04:00
Travis Truman 36c5d83718 Ansible 2.x - Address deprecation warning of bare variables
Ansible 2.2 will not allow "bare" variable references
in with_* loops. See https://docs.ansible.com/ansible/porting_guide_2.0.html#deprecated
for details.

Change-Id: I10868644a57ef303070a2a4c096db1b96ff80e43
2016-04-21 11:57:49 -04:00
Kevin Carter a0eda70cf8
Updated role using the Multi-Distro framework
* 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>
2016-03-21 22:57:11 -05:00