Commit Graph

49 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov d3ef8b1256 Deprecate openstack-ansible-galera_client role
Since we moved all functionality of galera-client part to galera-server
role there's no sense in futher keeping and branching of client part.

Depends-On: https://review.opendev.org/c/openstack/project-config/+/765777
Change-Id: I1623dbc80bee4eb7d889ee570d0ce27697b58cea
2020-12-07 12:41:44 +02:00
Georgina Shippey b89d5a94fe Install mariadb-client for mysqldump command
When using the nova to placement db migration script, debian users will have
issues using the mysqldump command as the mariadb-client-core package doesn't
include this command. The packages installed for the other distros do install
mysqldump alongside more tooling, this would bring debian to feature parity.

db migration script:
https://opendev.org/openstack/placement/raw/branch/master/placement_db_tools/mysql-migrate-db.sh

What we currently have:
https://packages.ubuntu.com/disco/amd64/mariadb-client-core-10.3/filelist
What we could have:
https://packages.ubuntu.com/disco/amd64/mariadb-client-10.3/filelist
Example of what an other distro gets:
see line 543, # mariadb-client.files
https://build.opensuse.org/package/view_file/server:database/mariadb/mariadb.spec

Depends-On: https://review.opendev.org/#/c/695238/
Change-Id: I50b1cde1a82a855d54c54b43f8d141df9583205c
2019-11-26 13:11:41 +00:00
Dirk Mueller 1fce4446f6 Fix galera_client 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: I64c6796e4324717dd98aa8488bc3e83b31073c45
2019-06-19 16:14:00 +02:00
Mohammed Naser 96a7b8694a [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.

Change-Id: I215dc9bca6eb586b9c18c85f29a644ef25de41ea
2019-05-09 23:53:25 -04:00
Mohammed Naser 83bb65e98c debian: add support
This patch adds support for this role to be able to deploy on
Debian Stretch.

Change-Id: Id55ff6d54192b282c203753604bcb5fb7dcbd69b
Needed-By: I9a92b73c419a0dc1cca40dacfef75de61a61db94
2019-04-05 22:04:10 -04:00
Zuul 6277f90074 Merge "add gentoo support to galera_client" 2019-02-26 14:18:50 +00:00
Matthew Thode b248d73899
add gentoo support to galera_client
Change-Id: I1506c5df2653b18a7d6e3294efb2e8bca857711c
2019-01-27 00:16:24 -06:00
Mohammed Naser 8d5ff261dc cleanup: stop installing mysql headers
Due to the fact that we use pyMySQL which is a pure Python
implementation of MySQL, we don't need to install the development
headers because we don't build MySQL-Python anywhere.

Change-Id: I57246c0a0538ccfd621a79454a8f9b5a21c65422
2018-12-29 17:53:50 -05:00
Jesse Pretorius 6c7aee86f5 Use in-repo GPG keys
We make remote network hits to get the GPG keys which are quite
unreliable, and apt_key does not support using a proxy properly [1]
so let's store them inside the role and use them.

The implementation here is derived from that which was done in the
galera_server role in I9443f10e8c803599cbebfc2a53cb9c432bfa60d1,
but opts to use a mechanism that will be simpler to maintain.

[1] https://github.com/ansible/ansible/issues/31691
Change-Id: I520ccbadf3320b0d07fc83e3dbec9ea2bd16ec83
2018-12-14 19:36:40 +00:00
Jesse Pretorius d1d4bf4ac7 Find the list of packages to remove using rpm
In https://review.openstack.org/603056 we tried to remove conflicting
packages from the target host before installing packages from MariaDB,
but that didn't work because the package specified didn't exist. The
name used was an attempt to remove a specific version of the package
to avoid yum always removing and reinstalling the same packages.

Unfortunately yum is case-insensitive, and CentOS/EPEL/RDO have
mariadb-* packages, while the MariaDB repo has MariaDB-* packages.
These packages conflict.

To work around yum's case insensitivity, we have to query for any
installed packages using rpm (which is case-sensitive) and remove them.

We have to remove them without dependencies, otherwise for distro
package installation types on shared hosts it removes far too many
packages.

Change-Id: Ide19d3c1b8b0f1e6aed2ea01f2f082e6a2cbb83a
2018-09-18 03:43:30 +01:00
Markos Chandras e74cdc2911 RedHat: Remove packages with conflict with MariaDB
Fixes the following problem since the upgrade to MariaDB 10.2

 file /usr/lib64/mysql/plugin/mysql_clear_password.so from install of MariaDB-common-10.2.17-1.el7.centos.x86_64 conflicts with file from package mariadb-common-3:10.1.20-2.el7.x86_64

Change-Id: I686ff5d70548f15a60f623e30b0b37fb0d525b8b
2018-09-17 11:36:10 +01:00
Markos Chandras 1e49eb8a48 SUSE: Add support for openSUSE Leap 15
Change-Id: I1c34a95218c4a2751143836329dd6062ca4cefa8
2018-09-12 15:55:19 +01:00
Markos Chandras 03bac540a8 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.

Change-Id: If1aaea61b89ea38161451872754b79d151da540f
2018-09-12 12:10:46 +01:00
Jesse Pretorius c2ac9b5ff0 Use generic vars file for ubuntu
These vars work for both Xenial and Bionic

Change-Id: I761580fb37ee0d9a4fed5fb0c6c423be8fa5fd3f
2018-08-01 11:39:37 +01:00
Mohammed Naser 6b705298a5 Use OpenStack infrastructure MariaDB mirrors
We have mirrored provided by the OpenStack infrastructure which
should reduce the amount of network failures with MariaDB.

Also, use nodepool variables so that we use our infrastructure
provided mirrors.

Depends-On: I49a744ee5c41279f4a17bc7d2339d12c3a132026
Change-Id: I81f716f640f6742c787e7aaedfdbf942893142de
2018-06-28 14:20:29 -04:00
Jonathan Rosser 138bbe6295 Ensure that mysql_config is present
mysql_config is required for subsequent pip installs of
MySQL-python.

Change-Id: I350cbbc283cdc0c9d1c6df144c4bb420fa45d86c
2018-06-21 10:44:00 +01:00
Markos Chandras 6275df2d2d vars: Do not install MySQL-python
We do not need to install the MySQL-python module since nothing really
needs it. The purpose of this role is to simply install the mysql client
on the host. As such we can drop this module and all the devel packages
which are required to build it.

Change-Id: I6535479bf2ca915e37b48c673024390baac7dd41
2018-06-08 14:52:17 +01:00
Jean-Philippe Evrard fea1b6bc64 Add Bionic testing
Now that bionic testing is added into the tests repos, we can
start testing it in the repo.

The /etc/apt/sources.list.d/ is not created in all the bionic
images, so we ensure it is created before using it.

Depends-On: https://review.openstack.org/#/c/566959/
Change-Id: I05c1bc8a0413dbb88514905b6fdf33304829484f
2018-05-14 20:51:59 +02:00
Jesse Pretorius 2d81894b06 Remove perl library from Ubuntu installs
It seems that the package was added a long time ago [1], and might
have been needed for the percona tooling. This makes sense if we're
downloading the dep - but we're no longer doing that and can rely
on apt's resolver to find the correct packages. Even then, this is
the client install and doesn't use percona anyway.

[1] https://review.openstack.org/238748

Change-Id: I9a9f877e818c94954e7fb3e86edef7295c51d2e2
2018-04-20 08:57:53 +01:00
Markos Chandras b176f008c1 vars: Switch to galera HTTP server on all distros
Commit I2071b0690778669a81770630f25c3dbfa567c818 switched from https
to http for the galera repo on CentOS but we can extend that to all
distributions in order for the repo server to cache things properly.

Change-Id: I8bef9cbfd82b9be7c53fdb432f98838fab99eb0b
2018-03-02 10:51:32 +00:00
Major Hayden 33a8fa0e74
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: I2071b0690778669a81770630f25c3dbfa567c818
2018-02-20 15:19:45 -06:00
Zuul ccafe5e816 Merge "Revert "RedHat: Ensure that conflicting MariaDB packages are removed"" 2018-02-09 09:04:19 +00:00
Mohammed Naser a726ae1ff9 Revert "RedHat: Ensure that conflicting MariaDB packages are removed"
This patch uninstalls the MySQL server from the system when
it shouldn't be messing about with it as the role manages the
client.

This reverts commit 72cc31a4d6.

Change-Id: Ief5cf57e23dfbf9a05aa9051d0ec46d85ac19bbf
2018-02-08 21:57:32 +00:00
Jean-Philippe Evrard 3524b8352f Prevent latest mariadb version
Latest mariadb version has a bug that prevents clustering from
behaving properly in bootstrap.

This setups the repo for the galera_client to the same as
galera_server, to have the same client version.

Change-Id: Ia1d7a2c664c6c11ad698a915162281c11a344067
2018-02-08 19:51:29 +00:00
Markos Chandras 72cc31a4d6 RedHat: Ensure that conflicting MariaDB packages are removed
When the galera_client 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.

Closes-Bug: #1739472
Change-Id: Ie1a2126986ee95671ece79374e1385846c8cce1a
2018-02-07 12:01:17 +00:00
Major Hayden bd1f43f123 Update MariaDB CentOS yum mirror URL
The yum mirrors for MariaDB have changes to the directory structure.
This patch updates the directory structure and chooses a faster
mirror from the US to use for installation.

Closes-Bug: 1747740
Change-Id: I213b66cddcad8328d7606385354a0a7194a5c569
2018-02-07 10:40:01 +00:00
Markos Chandras bb6feac7ab SUSE: Switch to upstream MariaDB repository
The OBS development repository was proven to be quite fragile since
the mariadb packages were moving far to quickly. Whilst this has helped
to catch bugs when OpenStack services were used against newer MariaDB
versions, it also created a very unstable infrastructure for openSUSE
deployments. As such, we have now switched to using the upstream SLE
packages as provided by MariaDB upstream so all distributions are
aligned to how they deploy the Galera clusters. This further allow us
to report upstream bugs which fix problems across all distributions.

Galera server Role fix: https://review.openstack.org/#/c/536955/
Change-Id: Ib270b0fe23de76620491247efc3352fbc6c1e9b5
2018-01-24 15:22:35 +00:00
Logan V 53c4e101fe 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_client_repo_url: "http://mirror.mydomain.com/mariadb/repo/{{ galera_major_version }}/ubuntu"

Change-Id: Ic6a11da9994c5f4bddeb392cbad7e40400c5c117
2017-09-14 15:26:28 -05:00
Markos Chandras 9774f0c068 SUSE: Add ability to configure external mirror for openSUSE
Allow deployers to choose a specific mirror for the OBS packages
by setting the 'galera_client_opensuse_mirror_obs_url' variable

Change-Id: I51e78cfc3dc2b84141e8a19f31bfc36a81113ab3
2017-09-07 11:32:58 +01:00
Jesse Pretorius 1faa81c5a1 Fix MariaDB apt package pinning
The variables in vars are only loaded when the include_vars
task is run, which is after meta-dependencies are processed.

This patch ensures that the pinning is properly applied when
the meta-dependent role is executed.

Closes-Bug: #1712315
Change-Id: Ib99afee1a3bf9fba8d34c63ffa28e5fa41b73d03
2017-08-23 08:05:47 +01:00
Jenkins 44db92f7bb Merge "Allow MariaDB gpg overrides without extra-vars" 2017-08-10 21:57:59 +00:00
Jesse Pretorius 9305bc7798 Allow MariaDB gpg overrides without extra-vars
It may be required to override the gpg information
without being forced to use extra vars. This patch
allows that to be done.

Change-Id: I7b6d4ebba44ad3ac42ab5df219646525b1bd7b9f
2017-08-09 10:19:47 +00:00
Major Hayden 7e65c47d59
Install MariaDB-shared
The MariaDB-shared package has special metadata that states that it
replaces the existing mariadb-libs that comes from CentOS or RDO.
yum will happily trample the existing packages and install the
MariaDB upstream packages, but dnf is more strict when it comes to
obsoleting packages.

Long story short: yum has let us do some bad things.

This patch ensures we install MariaDB-shared explicitly as part of
the package installation on CentOS.

Implements: blueprint centos-and-dnf
Change-Id: Ib67f7e4e40c0a1d6568c231c2ae50abcd0553992
2017-08-08 16:22:30 -05:00
Jesse Pretorius 5bf760a412 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: Ic7e77f0a442a82a424e75a9d79c9c6116818cfc1
2017-08-08 17:54:48 +01:00
Markos Chandras 7714dc68f1 vars: suse-42: Drop libgcc_s1 dependency
openSUSE provides multiple versions of gcc (and libgcc) and the
correct variant of libgcc is always pulled in when we install
'gcc'. As such, drop the explicit libgcc_s1 dependency and let
zypper pull the correct version for us.

Change-Id: Iafb3a6d6588f9667fc9cc464f24f40ef82f316da
2017-07-06 14:58:35 +01:00
Markos Chandras 1a4c83af1c SUSE: Use MariaDB package from the OBS repository
Use the Open Build Service server:database repository to get the
MariaDB package which contains proper galera support for openSUSE
Leap. This also renames the vars/suse.yml file to suse-42 in order
to support just the openSUSE Leap distributions which are more stable
than Tumbleweed.

Change-Id: I77fbc7447ac3908b904b0313b11dc1d5f82b5376
2017-03-10 12:54:28 +00:00
Jesse Pretorius e106ac12b2 Move repo URL variables to defaults
This patch deprecates the apt/yum specific variables
and moves the common URL variable to defaults to make
it possible to override without using extra-vars.

This technique matches the mechanism used in the
galera_server role.

Change-Id: Iaf9a23d1cbc0601d13bf2e467437d3775da9c812
Related-Bug: #1669897
2017-03-06 14:39:51 +00:00
Markos Chandras 07bc2ba504 Add SUSE support
Add new variables and tasks files for SUSE based distributions. The
required packages are present in the default repositories so no
additional repository configuration is necessary.

Change-Id: Idd7cc55baabf7e2da0807cedd3a37a7d887f3219
2017-02-20 21:53:50 +00:00
Jean-Philippe Evrard 8935c29e70 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: Ic83d464512f6f8697e520d79520dcf21370f8beb
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
2017-01-03 13:38:47 +00:00
Andy McCrae 99f1f7d59f Remove Trusty support from galera_client role
Change-Id: I739651ff2c36fbe487abb3ad7f56038c0a12e748
Implements: blueprint trusty-removal
2016-12-15 12:41:21 +00:00
Jimmy McCrory 6743229aa5 Install MariaDB 10.1 client
Update repos and packages to install the client for MariaDB 10.1, the
current stable release.

Make use of the yum_repository module for installing on yum based
systems and give the apt repository file a consistent name, 'MariaDB',
for easier maintenance and handling of upgrades going forward.

Change-Id: I8939703f26e5d8adc393b984266f4cad7a6e0b4c
2016-11-24 09:57:35 -08:00
Jesse Pretorius b0d03a3bb9 Set MariaDB GPG key to be fetched via HTTP
Due to an expired certificate being used for
https://yum.mariadb.org the GPG key is set to be
fetched via http.

Change-Id: I9c488f88dbc4c5cb500e6f57d24fec52ddbb21c0
Related-Bug: #388205
2016-10-19 07:51:58 +01:00
Jesse Pretorius 4b7a4e39e8 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: I9fd9e3ca1aec2d76cd78c4013bbb85c189e2d5e5
2016-08-26 14:49:36 +00:00
Jesse Pretorius b58ba2ee4f Allow apt cache_timeout to be overridden easily
The cache_timeout variable is moved to the role defaults to allow it
to be overridden more easily and to be exposed in the role docs.

Change-Id: I4dba478a6c0c4fd17abbee40df10a0470af362a4
2016-08-22 15:54:52 +01:00
Kevin Carter 00f5f4d457
Change the repos to use upstream default
This changes the default repos scheme to use the upstream
default which is "http" instead of "https". This change is
in support of enabling packages to be cached instead of
proxied which will improve the speed of deployment.

Change-Id: I67a9fb48ee08866bd59d70730e62b7da28f81125
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-07-22 10:38:39 -05:00
Kevin Carter d394277b21
Update Multi-distro support for CentOS7
This commit updates the role to support Ubuntu 14/16.04 and CentOS7

Change-Id: Ieadcdd70e9b8271aee3880896255a5037f56567e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-05-15 21:59:40 -05:00
Bjoern Teipel 7bc98c2a5c Add mariadb-client-core-10.0 to galera client role
This fix resolves the issue when upgrading from Kilo to Liberty
by adding a explicit install of the MariaDB client core package.

Change-Id: Iac4d84bda2285a93def4a90e27337c5cc9238a87
Closes-Bug: #1577546
2016-05-13 12:11:18 -05:00
Michael Gugino 808ef635fe Implement Xenial Support
Galera client currently only supports Ubuntu 14.04,
trusty.  This patch set is intended to support
Ubuntu 16.04, Xenial.

Change-Id: Iab5485529cf14933fd7f37430d234a5c41185c18
Needed-By: I4baeb2eddf137619ffedba2f9efd61b7bd142f92
2016-05-10 16:41:06 -04:00
Kevin Carter 0361308dbb 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: Iedc70ee2898c94d326c1a16f2b0064950a7dbd91
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-03-21 21:41:53 -05:00