The .cnf files can have valueless options present.
This commit ensures that these valueless options are not ignored
Addtionally, my.cnf overrides are added to the variable overrides
test file to ensure that the my.cnf file can run through the
config_template engine properly.
Change-Id: I8b09c2520c84bb43353b4c56bac157259f71b041
Closes-Bug: #1693234
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
Dynamically include the correct galera_upgrade_check task file based on
the ansible_pkg_mgr variable.
Change-Id: Icf7a2556fc303f8920a85873a6f44d4548b7f459
In order to have a consistent systemd behavior across distributions, we
define the Restart condition for the galera service file. The 'on-abort'
option is currently the default in the upstream service file and it's
also the most conservative one so we chose that to be the default option
in the Ansible role as well. We also set a reasonably low RestartSec
value as well.
Change-Id: If442802f7aff4473cbb573ba1c123cfc46bde9b3
Similar to the galera_running_check play, we should retry a few more
times if the MariaDB service failed to start.
Change-Id: Ie07468a065af0668db1da1d52b81af3fcee53dca
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
This patch adds the `galera_disable_privatedevices` variable that
allows deployers to disable PrivateDevices in the systemd unit file
shipped with MariaDB 10.1+ on CentOS 7 systems.
This is a workaround to fix the systemd/LXC issues with bind
mounting an already bind mounted `/dev/ptmx` inside the LXC
container.
See Launchpad bug, lxc/lxc#1623, or systemd/systemd#6121 for more
details.
Co-Authored-By: Major Hayden <major@mhtx.net>
Closes-bug: 1697531
Change-Id: I8a74113bd16a768a4754fb1f6ee04caf1ac82920
Task "Start mysql node normally" needs to add "galera-bootstrap"
tag or it will causing conditional check error on mysql_started
variable
Change-Id: Id7e3fd30480b39b200cffb085c212b5ab5229f04
Closes-Bug: #1680694
MySQL SSL connections allowed. Self-signed SSL bundle
created and placed to the deployment host, or user-provided
SSL bundle (CA, cert and the key) is used.
Change-Id: Ibac61d45cea67123fe61a6de4f906b4bd1949a34
Partial-Bug: #1667789
During an upgrade, we run the upgrade in serial, and we attempt to
bootstrap the cluster from the "galera_server_bootstrap_node". This
causes issues when there is an existing cluster that is still up.
To avoid this, we can simply attempt to start the cluster normally, if
it fails to start, and join the existing cluster, we can bootstrap as
usual.
Additionally, we can make the bootstrap slightly more efficient by only
running it against the bootstrap host and splitting out the
"galera_upgrade_post.yml" tasks.
Finally - run the upgrade in serial which mirrors our approach in the
integrated repo.
Change-Id: Ic4d69f0fa75c1eea81d10a76cca9a8d9c3822094
Closes-Bug: #1667103
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
The file vars/main.yml is automatically loaded
so by using this file name we're able to get
rid of the task that loads vars/common.yml which
is a small optimisation.
Change-Id: I4e32c8e10414080a5c0bd14df874a28b8f28e9fa
When changing the repo URL, the metadata does not reliably
update, resulting in the right URL being used, but the
wrong package list. This is why we force the metadata to be
cleaned out whenever the repo config changes.
Change-Id: I9bca9a89b58cd539dd5c224d6b141dc4d844bcc2
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
Since the systemctl daemon-reload has been added we're seeing some race
conditions that are causing intermittent failures. We can utilise the
retry option for galera_running_check and ensure the service is running
before continuing.
Change-Id: I7937a71f81862db3de682e45dda62fa0432c31a1
In the galera post install playbook, the systemd configuration files are
modified. This change verifies that systemctl daemon-reload is called,
so that these files are re-read, and the configuration is up-to-date.
Closes-Bug: #1656821
Change-Id: I5d8fcf1f2500146fc86db4dd19cd30aaa1055adb
This patch fixes the galera running checks so that they work
properly on CentOS.
Closes-Bug: 1660445
Change-Id: I7638456239aa23a7e5cd6027d1a399cfdadf4aaa
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>
NB There was an issue with https://review.openstack.org/#/c/395932/
which meant that "pid1_name != systemd" got changed to
"ansible_service_mgr == systemd" - since we are removing trusty this
task has been removed, but a fix for Newton will be made.
Change-Id: I2f502737e2cc52678cf479de2ef94b818e253622
Implements: blueprint trusty-removal
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
The galera_server and galera_client roles both configure the apt or
yum repository for galera and percona. This can cause a conflict if
the version of the client and server differ.
This patch sets the galera_client dependency to deploy the /root/.my.cnf
file rather than installing all the client packages as well. The client
package is already deployed as part of the galera_server role
deployment.
Change-Id: I9534a02d4ce827a2f0fdf415a11e37808be941e5
Depends-On: I00d662a8afc7ddd4778787d31dc394a0ea3b1401
This patch removes some extra tasks for detecting systemd and uses
the `ansible_service_mgr` fact instead.
Partial-Bug: #1640125
Change-Id: I1a30b79a759057afb74f24f2239f474b60c1db35
The /etc/default/mysql file needs to be sourced for systemd to start
mysql with the appropriate MYSQLD_STARTUP_TIMEOUT value.
We are already adding the line to source the /etc/default/mysql file in
the init.d/mysql script, but we were skipping dropping the defaults file
when using "systemd".
Additionally, this groups the init file change and the default file
templating to be sequential.
Change-Id: If5dc328e67bde9d84f40c2b192c217e82e1987eb
Closes-Bug: #1634562
The 'galera_upgrade | bool' when clause is already being applied to each
task of the galera_upgrade_pre and galera_upgrade_post task files when
they are included.
Change-Id: I676665aa6230ea2fafa8a90ef7fec1d8eeddf0f8
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>
The initial keyserver usage should ignore errors so that
the fallback keyserver can be used. However the second
task should not ignore errors as there is no third
keyserver - if the first has failed, and the fallback has
failed, then the task should fail and the installation
should stop.
Change-Id: I60fdbbde70f9bb14cfdf57e4c357f1cd0fc24f55
Ansible 2.1.1 introduces a regression in the way conditional
includes are handled which results in every task in the
included file being evaluated even if the condition for the
include is not met. This extends the run time significantly
for a deployment.
This patch forces all conditional includes to be dynamic.
Change-Id: I18d8c2119e00aeec3c53cb7e39c8cf09cf5135f8
Related-Bug: https://github.com/ansible/ansible/issues/17687
On a running galera cluster, we don't want to unintentionally allow a
galera_cluster_name from changing. This will cause a cluster to fail to
start (if the nodes are restarted sequentially) as the cluter name value
has changed.
To ensure we can still change this value, a new
"galera_force_change_cluster_name" variable is added, which can be set
to "True" in order to change the cluster name.
Change-Id: I8bae038bd207a15d5731b9c91b78df851a4c1986
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