Commit Graph

42 Commits

Author SHA1 Message Date
Mohammed Naser 4626283538 [redhat] Update variables to be version agnostic
The RedHat-based operating systems such as CentOS have a pretty
stable list of packages, therefore, we don't need to pin it by
version and we can instead move to a much more generic redhat.yml
which will support a bigger range of systems.

This patch also sets up the mode for the /etc/mysql directory
to be 755 for things to work.  We should lock that down eventually
for only the MySQL user.

Change-Id: I2e9ee987a353a28da00cd37cbdb82ec46ccc414c
2019-05-10 16:35:47 -04: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
Jesse Pretorius 6fdecd17b8 Add PERCONA-PACKAGING-KEY
This patch adds /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY which
comes from installing [1] and is required in order to install
the percona packages on CentOS packages. Without it we get
the error:

Public key for percona-toolkit-3.0.13-1.el7.x86_64.rpm is not installed

We also rename RPM-GPG-KEY-percona to RPM-GPG-KEY-Percona in
order to match what is done by [1].

[1] https://repo.percona.com/yum/percona-release-latest.noarch.rpm

Change-Id: I2eeac8ea21c52fac3b1f32036fedcf7c62aac37f
2019-01-10 12:34:05 +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
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
Markos Chandras be75dd0604 defaults: Bump mariadb to 10.2 release branch
mariadb 10.2 was first released in April 2016 and OpenStack services
should be ready to use it by now, so lets switch to 10.2. For mariadb
10.2 we need to use xtrabackup-24. This version is not available in Leap
42.3 so we add an extra OBS repository for it.

Change-Id: I5f1aaf1f8608ad085acfebc8458910391f280193
2018-09-12 12:11:33 +01:00
Zuul 4a7aeff176 Merge "Do not remove MariaDB-server" 2018-07-12 10:55:15 +00:00
Vadim Kuznetsov 270eccd82a Do not remove MariaDB-server
Removing mariadb-server and mariadb-libs leads to
removing MariaDB-server and MariaDB-shared and its
dependencies
rpmquery --whatprovides mariadb-server
MariaDB-server-10.1.30-1.el7.centos.x86_64
rpmquery --whatprovides mariadb-libs
MariaDB-shared-10.1.30-1.el7.centos.x86_64

Which in turn shuts down the server.

Change-Id: I89df8f6b57b1ebe0ce96d63f193da35107d2bad9
Closes-Bug: #1762421
Related-Bug: #1742206
2018-06-28 11:18:49 -04:00
Mohammed Naser 2b0be1c5eb Use OpenStack infrastructure MariaDB mirrors
We have mirrored provided by the OpenStack infrastructure which
should reduce the amount of network failures with MariaDB.

Depends-On: I49a744ee5c41279f4a17bc7d2339d12c3a132026
Change-Id: I205e471dba844a98a5c81e0e387704bef648069e
2018-06-27 10:30:06 -04: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
Mohammed Naser 139b9b68fd Allow configuring custom repo host
In order to allow using mirrors, this introduces a new variable which
can control the host for the percona repo: galera_percona_xtrabackup_repo_host

Change-Id: I4d9d408f99608f1625dac9e0802e8d8d77b0f48b
2018-06-18 15:21:09 -04:00
Mohammed Naser ffa0c2d87a Stop installing percona-release and setup using yum_repository
Due to the security role adding the `localpkg_gpgcheck` option and
the fact that the Percona release RPM is not signed, it fails to
install leading to failing gate for CentOS.

The behaviour for Debian-based operating systems is to manually
install the repositories so let's switch CentOS to do the same.

Change-Id: I71840bd209cd398e0ce46d61ac895dea68ba193c
Related-Bug: #1675918
2018-06-07 09:03:57 -04:00
Markos Chandras 9ab9dd30dc Avoid mixing pip and distribution packages.
The hosts may end up in a rather messed up state when mixing
distribution and pip packages. The python MySQL bindings are already
provided in the distro repositories so we can simply use these in order
to keep the host as clean as possible.

Implements: blueprint openstack-distribution-packages
Change-Id: Ic8c7f642378536d79d763625451ec267c2a108fd
2018-04-18 16:39:10 +01: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
Zuul 978f1b1cd5 Merge "Allow Galera package downloads over HTTP" 2018-02-22 18:02:50 +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
Major Hayden e196be20ea
Allow Galera package downloads over HTTP
CentOS has a repo configured for MariaDB that uses HTTPS and this
prevents the repo server from caching the MariaDB packages. That
causes significant delays during CentOS 7 deployments/gates since
those packages are quite large.

This patch changes the MariaDB mirror URL for CentOS to use HTTP.

Closes-Bug: 1750665
Change-Id: I2192ade6eb204404fe67d47af063e0e57fbe7d62
2018-02-20 15:22:00 -06:00
Markos Chandras aff7866ffe vars: Install qpress only when galera_xtrabackup_compression is true
The qpress library is only needed for xtrabackup compression. The
compression only occurs when a new node is joining the cluster
which shouldn't happen very often. The variable is set to true only
when the architecture is x86_64 since that's the only arch that's
supported by the upstream repository and CentOS and Ubuntu do not
provide qpress in the downstream distributions at all.

Change-Id: Iae8b5d0e0998c85ee453efc6620940c80243540e
2018-02-15 08:22:49 +00:00
Jean-Philippe Evrard 8a42facf6b Prevent latest mariadb version
Latest mariadb version has a bug that prevents clustering from
behaving properly in bootstrap.

Change-Id: I21e96dbe7fd9acaedb7eee7cba2ae226fa0644d5
2018-02-08 10:23:41 +00:00
Markos Chandras 72057200ff RedHat: Ensure that conflicting MariaDB packages are removed
When the galera_server role is deployed along with other roles, some
of them may pull mariadb packages as a dependency for the services
they deploy. However, this role uses MariaDB packages from the upstream
repository which conflict with those provided by the EPEL or the RDO
ones so we need to ensure that they are gone before we install the
upstream ones.

Change-Id: Ie800c1f4628eff24954f392fe6318206adfabddb
Closes-Bug: #1742206
2018-01-17 16:01:18 +00:00
Mohammed Naser f2bfbd3851 Fix Galera socket for RedHat
At the moment, RedHat currently installs and listens on the
/var/lib/mysql/mysql.sock path, this can be seen by the following:

mysqld  13627 mysql   33u     unix 0xffff88079261cc00        0t0   3312115 /var/lib/mysql/mysql.sock

This patch resolves it which will allow the health checks to
function as they rely on the [client] section which contains
an incorrect path.

Change-Id: Iec88e911c6cf207bcea5bd067f9743b3eb50f60e
2017-12-22 14:22:54 -05:00
Zuul 691ffb3710 Merge "Update Percona XtraDB Backup version" 2017-11-30 04:51:01 +00:00
Jean-Philippe Evrard a99f018be2 Update Percona XtraDB Backup version
This is the time of the cycle where we update all the static
elements in the roles.
This version is defined staticly, so we bump it.
QPress has no updated package.
Suse has no definition for those packages.

Change-Id: I0af27722a0d7f2a3c3c0a456a0c60512e36a5728
2017-11-29 09:05:47 +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
Kevin Carter 94821f8108 Implement a proper WSREP check for galera
The galera cluster rely on WSREP for cluster consistency. While the
default MySQL monitor will allow us to know when the database node is
minimally functional it does not provide the ability to query the node
state allowing loadbalancers, operators, and deployers to know a node
is healthy prior to being allowed to accept connections. This change
implements the checkcluster script as provided by the fine folks at
Percona. The implementation of this check follows the guild-lines noted
here [0]. With this in-place, we'll be able to convert our haproxy check
for the galera cluster nodes to use an HTTP check on port 9200 instead
of the default MySQL login which will provide for a more robust and
fault tolerant cluster.

[0] https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/virt_sandbox.html
Closes-Bug: #1665667

Change-Id: Ie1b3b9724dd33de1d90634166e585ecceb1f4c96
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-11-29 01:52:15 +00:00
Markos Chandras bc8a4826ac templates: Configure galera socket per distribution
openSUSE uses /var/run/mysql/mysql.sock instead of
/var/run/mysqld/mysqld.sock so make this option distro configurable.

Change-Id: I5a42bd5bdab1a89bfc1e39b6764a1380d8d98918
2017-09-28 14:14:59 +01:00
Logan V 039ece94a0 Set a var for the MariaDB major version
Setting a custom MariaDB mirror URL is very tedious to maintain
because operators must ensure they update the overridden repo
URL every time the major version changes within the galera role.

This will allow operators to set overrides for their local mirror
like:

galera_repo_url: "http://mirror.mydomain.com/mariadb/repo/{{ galera_major_version }}/ubuntu"

Change-Id: Ie5dd27b8cffff5245724ecc79e79272086bf3b30
2017-09-14 15:17:42 -05:00
Jesse Pretorius 1b5d18ca09 Toggle percona repo without extra-vars
Currently overriding this setting requires the
use of extra-vars. This change allows it to be
done via any other variable override.

Change-Id: I842fecfcf851b026c008f4fd1296c790bd00c5cc
2017-08-15 14:02:57 +01:00
Jesse Pretorius 96021e839f Allow MariaDB repo overrides without extra-vars
It may be required to override the repo information
in its entirety, rather than just the URL. This
patch allows that to be done.

Change-Id: I9cfd0ae520b9b584ddc50933311c3fdb555d5029
2017-08-09 10:22:56 +00:00
Markos Chandras 34d3b00255 Add support for the openSUSE Leap distributions
Add support for the openSUSE Leap distributions. For openSUSE we use the
packages provided by the Open Build Service repository which contains the
Galera clustering support. These packages are different compared to the
CentOS7 and Ubuntu ones so the way the cluster is being bootstrapped is
also different. The systemd service file can't be used for that, so we
need to modify the MariaDB configuration file on the boostrap node to
initiate the cluster. Moreover, files are installed in different places
so we need to modify the distribution files and templates to take that
into consideration as well.

Change-Id: I1ac31fbc06152da7f93e57911d4a952f0dd83849
2017-06-19 20:57:29 +01:00
Logan V 963d7a06ed Add fallback fetch for xtrabackup and qpress
Change-Id: I87313ded52b2c1046782b45e90f2a73e5b8dcc90
2017-04-26 00:37:44 +00:00
Jesse Pretorius f939bf150f Upgrade: Make removal list distribution-specific
When trying to execute an upgrade the removal fails
if packages in the list are included that cannot be
found in one of the repositories configured.

This patch endeavours to only remove packages that
will be found.

Change-Id: I67cc225b25fca005cdba3bf67793b4f23d6ae82a
2017-03-16 11:05:23 +00:00
Jean-Philippe Evrard 2ec8d8407a Update xtrabackup version
This patch bumps the version of the percona xtrabackup tool, and
ensures that CentOS/ubuntu are running the same version.

Change-Id: I3e82c7be72df67604dbf43a5123a08bdbc1ed8a9
2017-01-04 18:17:12 +00:00
Andy McCrae 75d2b971d7 Use local facts for ansible_architecture
This patch ensure the local host's ansible facts are used for the
"ansible_architecture" fact, rather than the "physical_host". Since we
don't explicitly collect facts for "physical_host", and the
ansible_architecture fact is set for the local host container, we
don't need to try to retrieve the "physical_host" facts.

A new var "galera_package_arch" is created so that the architecture can
be overriden if it isn't being calculated correctly. Additionally, the
duplicate vars that are not specific to distributions have been moved
into defaults, and out of the specific distribution vars files.

Change-Id: I5124c061faf124388a88eefee93d96e9a9e90d8f
Closes-Bug: 1650384
2016-12-22 16:12:35 +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
Donovan Francesco (drifterza) 14cc72deb7 Updating MariaDB yum repo to use SSL.
Change-Id: I97f709799d63389ec2e80c33a9585eff118db0ab
Closes-Bug: #1634756
2016-11-23 16:24:02 +02:00
Jimmy McCrory 6eb67a2420 Update signing key for percona packages
Percona has started signing their Ubuntu packages with a new key.
Update the galera_gpg_keys var to add it to the keyring.

https://www.percona.com/blog/2016/10/13/new-signing-key-for-percona-debian-and-ubuntu-packages/

To resolve a reno dependency required to pass gate testing, also include
the libjpeg-dev package in bindep requirements.

Also, due to an expired certificate being used for
https://yum.mariadb.org the GPG key is set to be
fetched via http.

Related-Bug: #388205
Change-Id: I1dc3a78b8e0b759cc98f3de2bd33774db3b477da
2016-10-19 07:24:16 +01:00
Jimmy McCrory 1b0d2d3aa2 Set default for physical_host if it's undefined
physical_host is a host variable created by openstack-ansible's dynamic
inventory. When using this role outside of an integrated OSA deployment
it wouldn't be expected to be set. Fallback on using inventory_hostname
when physical_host is undefined.

Closes-Bug: 1631158
Change-Id: I3364aac2e707d10ac9b4020dfcc0de7d4d158ff9
2016-10-08 10:05:03 -07:00
Marc Gariepy be35df425a Cleanup duplicate key warning.
percona_package_download_validate_certs was defined twice

Change-Id: Ide43fd4ccbb335fefc3b904610232f11e350c132
2016-10-03 15:11:11 -04:00
Adam Reznechek b1ed69fe75 Fix arch-specific percona-xtrabackup and qpress
Add architecture-specific location support for percona-xtrabackup
and qpress packages to fix limitation of hardcoded amd64 packages.

Change-Id: Ifa9d53a91f6ae7d497045fa4e7558c1b7c4d53a8
2016-09-01 22:52:23 -05: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
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