Commit Graph

108 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 1ae0dd6165 Install compatibility package for mariadb-dev
For compatibility with mysqlclient and to ensure that pkg-config will
successfully find required libraries, comapt package is required to be
installed.

Change-Id: I0cd4073c276a10e5cce727b360ab99ec790e30eb
Needed-By: https://review.opendev.org/c/openstack/openstack-ansible-os_adjutant/+/888985
2023-08-31 17:01:17 +02:00
Zuul 486c5d07b8 Merge "Remove galera-4 package during upgrades to force version up" 2023-08-30 10:10:00 +00:00
Zuul e8663b04ed Merge "Fix linters issue and metadata" 2023-08-18 15:16:42 +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 c12dc00258 Replace libgcc1 with libgcc-s1 for Debian
libgcc1 is a meta package for Ubuntu 22.04, thus it's worth to
replace it with what this meta package actually provides.

Change-Id: Ie95d42533e85f8e46d9c3d2c2691fed372144615
2023-08-08 19:52:49 +02:00
Andrew Bonney 27cd830c65 Remove galera-4 package during upgrades to force version up
Current upgrades leave the galera-4 package in place which
can cause incompatibilities when the mariadb binaries are
updated.

By forcing removal of this package during upgrades it should
be re-installed with a version matching the rest of the
mariadb packages.

RHEL distros already have a removal step for galera-*

Change-Id: I99d993a7c466cb744136bd06f4ab2e21c2569151
Closes-Bug: #2028946
2023-08-08 13:40:19 +01:00
Dmitriy Rabotyagov 670e88071b Define GPG key for repo
With update of GPG key that was made in [1] we broke upgrade path,
since new key is not being updated by gpg_key module and it results
with OK state despite new content it placed to GPG keyfile

With that patch we replace usage of gpg_key with defining gpgkey
option for yum_repository, which treats it way more properly and
fixes upgrade path as well as simplifying overall flow.

[1] https://review.opendev.org/c/openstack/openstack-ansible-galera_server/+/879150

Change-Id: Ie322e0e69c5e7b2acd55bc18cf23fed1fa8f4f17
2023-04-06 16:29:49 +02:00
Dmitriy Rabotyagov 515bec4165 Upgrade MariaDB to 10.11
10.11 is the next LTS release of MariaDB which has been released
recently. Let's switch to using new LTS from 10.6 that we're using
for quite a while now.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/879069
Change-Id: I430acf61fd4fdacdead19d0c5cc2765e017eb3c7
2023-03-31 17:22:15 +00:00
Dmitriy Rabotyagov e04aeacc58 Bump mariadb version to 10.6.10
With that we also able to use MariaDB provided repo for
Ubuntu 22.04 and CentOS Stream/Rocky 9

Change-Id: I4181691ba3b23c5195b3cee3699637ece94187db
2022-10-06 08:35:42 +00:00
Andrew Bonney 5200b50cf6 Add the ability to specify custom additional galera users
This provides the capability to add and remove additional users
in the Galera database which may be used by external resource
monitoring systems (for example).

The Ansible mysql 'resource_limits' variable is also exposed to
enable setting connection limits against individual users.

Change-Id: Idcc9251340215baf5e6f550a9ca844c8c097d353
2022-09-12 13:24:37 +01:00
Marc Gariepy 7b555f4119 Fix systemd and centos9.
* some package were missing on c9s
* fix systemd socket as it requires a list.

Change-Id: I9cf60ae7b16639a6bf06e050e284757b35dd0dce
2022-06-01 13:13:23 -04:00
Jonathan Rosser d083461eb0 Add support for centos-9
This uses the distro package for mariadb as there is no release from
mariadb.org yet.

Change-Id: I41cdbb82b6ef82ea7acb4d22ca29aac84efebe30
2022-05-12 14:20:19 +01:00
Jonathan Rosser 090d3cc63e Add support for Ubuntu 22.04
There are no official binary pacakges available for Ubuntu 22.04
so we use the distro provided version of MariaDB instead.

Change-Id: If8d8d8ff9bc5270bc077cf777f88bbaab142b8cd
2022-04-27 13:52:50 +01:00
Dmitriy Rabotyagov 5884ee918e Add galera_data_dir variable
Control mysql datadir with variable. Decrease code dublication since path
is heavily used in different places. If path needs to be changed
overriding config won't be enough.

Change-Id: I6fcefe216236ffea60da5fee42aad47c6f7da133
2022-04-12 11:27:03 +00:00
Jonathan Rosser 41553dfa7a Convert xinetd clustercheck to systemd socket service
Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/826602
Change-Id: I76e7498b1676a2b4c550fda049f332aa209ce53d
2022-02-01 08:27:12 +00:00
Jonathan Rosser 2ad823eafd Update galera to 10.5.12
Also remove vars/debian-11.yml so that bullseye takes packages from the official mariadb repo
rather than using the distro provided package.

Change-Id: I084f63d071394022b4b2dd6ad1433e4036adc978
2021-08-12 09:58:13 +00:00
Dmitriy Rabotyagov 818c5a71b0 Replace systemd unit overrides with role
Instead of placing bunch of templates, we can use our systemd_role
that is capable of placing just overrides file, that will have same
functionality but also provide ability to easily add required data into
systemd overrides.

Change-Id: I7b3b0f4da047f82a49266ef57fba2fbaa24cebdc
2021-06-16 15:40:29 +03: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
Dmitriy Rabotyagov f6bd5c9e53 Add galera devel packages installation
There might be cases, where devel packages installation might be required
Since it's pretty specific usecases, we don't inlcude it into
tasks/main.yml and intend to use tasks_from during rule include.

Needed-By: https://review.opendev.org/c/openstack/openstack-ansible-os_adjutant/+/777607
Change-Id: I79be2197aa1859ece853a197ec685e4bc460c133
2021-05-05 14:22:16 +03:00
Jonathan Rosser 49b7d9488b Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: I50bb0f00658e292f39269c3980109e56319a00ca
2021-03-16 09:23:50 +00:00
Jonathan Rosser 374b64435e Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I88dc5a3da8b8abe801eb533ec93cffdbeed7bd65
2021-02-25 12:26:58 +00:00
Dmitriy Rabotyagov d089b8e2ff Do not remove mysql-common during upgrade
Keepalived 2 depends on mysql-common so it's removal will result in
cluster VIPs being down until re-running keepalived role.

Also the package we really want to remove is mariadb-common.

Change-Id: I5a87d9c7364ca36397b119c8b7261aebce26a1ac
2020-10-30 13:52:57 +02:00
Jonathan Rosser 7075e72c65 Update galera to 10.5.6
This is the first stable release from the 10.5 series.

Depends-On: https://review.opendev.org/758399
Change-Id: I76438e6519eac09be7f9729de3cefb4130f72dea
2020-10-15 11:21:39 +00:00
Jonathan Rosser c49b69dc5e Use temporary repository for MariaDB 10.4.14 for Ubuntu focal
Upstream MariaDB do not provide packages for 10.4 until 10.4.13.
That version suffers from a critical bug which causes the database
to segfault during the openstack database creation. This will be
fixed in 10.4.14 but that version is not due for release until July
2020.

This patch uses a repo providing a version of daily build of 10.4.14
compiled for Ubuntu Focal in order to progress development of OSA on Focal.

Depends-On: https://review.opendev.org/734672
Depends-On: https://review.opendev.org/735289
Depends-On: https://review.opendev.org/732013
Change-Id: Id584f5c770b35f2e78301edd55eeb0f0129363d6
2020-06-16 09:13:32 +00:00
Zuul 4819f088b0 Merge "Fix Mariadb 10.3 -> 10.4 upgrade path" 2020-06-15 11:08:21 +00:00
Marc Gariepy f678c329ce Add Centos-8 support
Change-Id: Ic59c26c51b5ea9a49c7721a1aa7641203950bc97
2020-06-13 17:10:02 +00:00
Dmitriy Rabotyagov 9e5497aa0a Fix Mariadb 10.3 -> 10.4 upgrade path
After bumping version to mariadb 10.4 upgrade path has been broken
as service name and packages have new naming patterns
for a while.

We also temporary disable ubuntu upgrade jobs to be able
to merge patch.

Change-Id: I3696b3131de424a4b30ff016da714aef22af4e59
2020-06-13 17:09:52 +00:00
Dmitriy Rabotyagov 0a36313fa0 Bump MariaDB version to 10.4
Patch aims to use next stable release of MariaDB

Remove no_log from functional tests, the only credentials used here
are for the purposes of the test and debug output is valuable.

Change-Id: Ic4cdc26ddf1cb0591f0a2218355b7cca7af0b0fb
2020-05-28 12:56:36 +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
Jonathan Rosser d74863bc52 Ensure python3 mysql client libraries are present
These are required when ansible uses python3 on the target host.

Change-Id: I97e8e9b8cb5aa4901207079c0c45813fe9d7f887
2020-04-03 21:10:55 +01:00
Jonathan Rosser 73ce6a8c9a Bump galera version to 10.3.18
Change-Id: Id15d75c8339b253b516fe5d7ce7fc95a812237ef
2019-10-09 07:09:01 +01:00
Francois Deppierraz aa6bb9bf9b Move to PyMySQL instead of MySQLDB for ansible-2.7
Running this module with ansible 2.7.13 to an Ubuntu 16.04 target was failing
with the following error message:

"The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module
is required."

Not sure why the fallback to using MysqlDB wasn't working, but it looks like
PyMySQL is the way forward.

This should fix https://bugs.launchpad.net/openstack-ansible/+bug/1824987.

Change-Id: Ic4ff3e24937d38e16fde843e350875c0024c92b2
2019-09-25 09:57:06 +02:00
Mohammed Naser 7c7ade4fc9 cleanup: refactor into galera_mariadb_service_name
We had two variable names which were duplicated for the service
name, this converges them all to "mariadb" which uses the actual
systemd unit instead of the init.d compatiblity layer.

Change-Id: I5805fb11a5118c4011701377cd30b2511edca505
2019-07-12 12:42:24 -04:00
Dirk Mueller 5965bf6e50 Fix galera_server installation for openSUSE Leap 15.1
The MariaDB repositories are offering a download repo under
the leap major version, e.g. "opensuse15" or "opensuse42" for all leap
42.x and leap 15.x versions, respectively. There isn't a specific
build for openSUSE Leap 15.1, so the previous logic selected
a repo url of opensuse-151 which does not exist.

Change-Id: Ia0985c03d51c3bfe06b98ae73a3533c3402453e3
2019-06-26 18:56:52 +02:00
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 3d8c1bf0fa debian: add support
This patch adds support for this role to be able to deploy on
Debian Stretch.

Change-Id: I1d218d3f7a43b59f39baaa9a76d1a73df52a0a99
Needed-By: I9a92b73c419a0dc1cca40dacfef75de61a61db94
2019-04-05 22:31:25 -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
Zuul 152ae31478 Merge "Add gentoo support to galera_server" 2019-02-26 19:23:43 +00:00
Matthew Thode ccf108ed24
Add gentoo support to galera_server
Depends-On: https://review.openstack.org/633289
Change-Id: I1ba3630e3f673aab419ebaff966f88868560df3b
2019-02-26 09:02:19 -06: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 8ec910c4c2 SUSE: Add support for openSUSE Leap 15
Change-Id: I655c81c9857b51dcdbf94fd1e955317d2812997e
2018-09-12 12:11:34 +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
Logan V b67230faa8 Remove deprecated python-software-properties
python-software-properties is deprecated on Bionic and
software-properties-common replaces it.

Change-Id: Idb51f94d8c88b373c3454b06ac7de7ca369fa7b0
2018-07-21 17:49:24 -05:00
Markos Chandras fddfad4cc2 vars: SUSE: Drop python-pycrypto from SUSE packages
Commit c41b80cee9 ("Remove python-crypto and use in-repo GPG keys")
removed the ancient python-crypto package from CentOS but it didn't do
it for SUSE. Similar to CentOS, we don't need python-crypto anymore for
Galera so we can simply drop it.

Fixes: c41b80cee9 ("Remove python-crypto and use in-repo GPG keys")
Change-Id: If8fc1641cc26e98e2851ccae95827fcfc4794282
2018-07-16 19:14: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