26 Commits

Author SHA1 Message Date
Ravi Gummadi
5b9ce0b551 Cap the number of worker threads
Users can configure the number of worker threads however when it's
not specified the calculated number of workers can get too large on
hosts with a large number of CPUs.

Change-Id: Ic0c77d03ab67d3850fa6b46010e63d886a96cc31
2017-03-01 07:41:09 -05: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
Andy McCrae
17e28956f0 Don't install client packages via the galera_client role
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
2016-11-28 20:44:13 +00:00
Jimmy McCrory
21885c1f37 On single nodes use an empty cluster address
When there is only one galera node, configure galera with an empty
cluster address. Each time the mysql service starts on this node it will
automatically create a new cluster.

Closes-Bug: #1624327
Change-Id: If653b1aacbd446a4ea5bb806a839dad40011b5b8
2016-10-05 16:02:04 -07:00
Travis Truman
6c1422cc57 Address ansible_ssh_* var deprecation
Replacing usage of ansible_ssh_host, ansible_ssh_user,
ansible_ssh_port with ansible_host, ansible_user and ansible_port

Change-Id: I35371879a87c115f219cd181245fe59f6d7d3f77
2016-09-17 17:44:24 -04:00
Andy McCrae
8a9127efbc Prevent galera_cluster_name from changing.
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
2016-09-13 17:32:53 +01:00
Jenkins
4b2f0dbada Merge "Rename package lists (and related vars) appropriately" 2016-08-26 22:00:56 +00:00
Adam Reznechek
ece430ab2f Work around Ansible vcpu fact bug on ppc64le
This changes how several fields using ansible_processor_vcpus are set to
work around a bug in Ansible where ansible_processor_vcpus is reported
as 0 on ppc64le today due to issues with /proc/cpuinfo format differences.
An upstream fix has been proposed at [1].

[1] - ansible/ansible#16533

Change-Id: I49a024aa2165db6501d9e26d09d7940cb0531bd4
2016-08-26 14:17:18 -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
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
Jimmy McCrory
090240e9e7 Use the apt_package_pinning role
Add the galera_apt_pinned_packages default variable which is passed to
the apt_package_pinning role, instead of a template within this role, to
pin the MariaDB repo.

Change-Id: Iea8b002b57fa72230056656f42eaa75e84e9b5a6
2016-05-05 19:08:04 -07:00
Bjoern Teipel
a1636b3bb3 Decrease MariaDB wait timeout
This MariaDB setting uses the same timeout for SQL connections
as configured inside SQL Alchemy (pool_recycle) and prevent possibly
SQL session build up due to a large default setting (8 Hours).

Nova and Neutron are using a idle_timeout of 3600 by default,
for example
https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L101
and respectively for Neutron
https://github.com/openstack/neutron/blob/stable/liberty/etc/neutron.conf#L761

Change-Id: I273739c3c10616cac148aeb839154e0fb3359bca
Closes-Bug: #1571682
2016-04-18 10:44:49 -05: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
git-harry
72a1dfb4d7 Use var galera_cluster_members to identify cluster
Create a new variable called galera_cluster_members which is a list of
the hosts that make up the galera cluster. Set the default value to
groups['galera_all'] which is the group used by openstack-ansible to
refer to the members of the cluster. Replace all other references to
groups['galera_all'] with the new variable. This allows other consumers
of this role to use their own group naming scheme.

Add a new task to verify that current host is a member of
galera_cluster_members.

Add the var galera_client_drop_config_file=true to the role dependency
galera_client, this is required because the default value for that var
in the galera_client role is based on membership of the galera_all
group.

Modify the functional testing to override galera_cluster_members, this
aims to prevent the return of any hard-coded role references.

Change-Id: I59af07217114a001cbebaa95a651919d53c9ec21
2016-03-17 09:30:36 +00:00
Jenkins
f02412b03c Merge "Allow cert validation to be toggled by deployers" 2016-03-14 20:46:24 +00:00
Travis Truman
d5f28a93bd Allow cert validation to be toggled by deployers
Default to validation, but allow deployers to override
if they have hosts behind a misbehaving proxy server or
are serving the deb from an alternate location with a
self-signed certificate

Change-Id: I5f104867c6c7dd41d288477a1c330ff3243644fd
2016-03-11 14:06:57 -05:00
Travis Truman
d79235a49a Ensure apt-transport-https is present before installing from secure repos
Most hosts will have apt-transport-https installed already, however
this should ensure that those that do not will successfully install
the MariaDB packages hosted on an HTTPS repository

Change-Id: I43c1c99ea85ea6f1ec1041cb03071d2c1557d4f4
Related-Bug: #1547541
2016-03-10 15:04:31 -05:00
Jenkins
51708fe0cf Merge "Only update apt cache if necessary" 2016-02-17 09:33:29 +00:00
Jean-Philippe Evrard
e1b4efc8dc Only update apt cache if necessary
Workarounding the upstream ansible apt module bug
documented here:

https://github.com/ansible/ansible-modules-core/pull/1517

For the next versions of ansible we'll be using, we should
check if the apt bug is fixed. When it's fixed, we could
abandon this change and use the standard apt module
with correct cache handling.

Change-Id: Id86af470197fe5b70724f0296f1cb0aed21bf826
2016-02-15 22:34:24 +01:00
Kevin Carter
b651fa3bd8 Added major version upgrade support
The change adds in the ability for the role to take care of a major upgrade
in a version of an installed mariadb galera cluster.

The change adds a new task file that checks if the installed version of the
galera cluster matches that of the specified major version. The role will
hard stop if there is a version mismatch and the option "galera_upgrade=true"
is not passed.

Change-Id: I26560668325d45f670c8b946c978c48559f58419
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-02-12 12:36:57 +00:00
Jesse Pretorius
f7f3b5007a Ensure that ansible_processor_vcpus always has a default value
In some cases Ansible does not detect the number of CPU's on the
target host. This patch ensures that in such cases there is always
a usable value.

Change-Id: I504d2ae34ce587a3ea6639e182d29303667139e3
2016-01-18 10:21:25 +00:00
Kevin Carter
cd11c5a56e Updated repo for new org
The role was changed to make it compatible with the OpenStack
CI. The changes effect defaults, handlers, and the tests for 
the role and adds gitignore/review files. 

The changes essentially get the role to a state where its passing
the tests which are spinning up a galera cluster, adding users 
and databases, and then testing integrity from every node. The 
tests specifically ensure we're able to guarantee that after the
role runs everything works. Previously to these changes the role
assumed everything was working and nothing had been done to 
guarantee cluster state. 

In the handler changes, the temporary "sst" directory is cleaned up
should the handler restart fail. This ensure that a node is in a clean
state if a leftover sst directory was on the disk which would cause 
a node to fail to join a cluster or bootstrap. Additionally the 
environment variable "MYSQLD_STARTUP_TIMEOUT" is now being passed
into the init script because the defaults are not being sourced
at the init script runtime. 

In the task changes a new configuration file, that is part of the 
mariadb package, is being removed which has unforeseen options within
it causing no logs to be created.

the default option "galera_innodb_additional_mem_pool_size" was removed
because its no longer valid within MariaDB10 and we'd never caught that
error message until now.

The tests were updated to support running the role from a user which 
was not root.

Change-Id: I16af30c660790656fc2d59f9943c172b88098905
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-12-14 15:20:02 +00:00
Kevin Carter
25a9eb3901
first commit
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-12-09 09:23:50 -06:00