Drop MySQL, Percona Server and Jessie support

pull/29/head
Emilien Mantel 2018-03-17 17:05:45 +01:00
parent 589754e618
commit 859bafdb50
13 changed files with 22 additions and 135 deletions

View File

@ -1,17 +1,10 @@
env: env:
- PLATFORM='docker-jessie-default-mysql-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-jessie-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-jessie-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-jessie-upstream-percona-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-jessie-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-stretch-default-mysql-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4'
matrix: matrix:
allow_failures: allow_failures:
- env: PLATFORM='docker-jessie-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4'
- env: PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4' - env: PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4'
fast_finish: true fast_finish: true

View File

@ -7,11 +7,6 @@ Install and configure MySQL or MariaDB (Galera Cluster) or Percona Server. Manag
| OS | Vendor | Origin | Managed versions | | OS | Vendor | Origin | Managed versions |
| --------------- | ----------------------- | --------- | ------------------------- | | --------------- | ----------------------- | --------- | ------------------------- |
| Debian Jessie | MySQL | Debian | 5.5 / 5.6 |
| Debian Jessie | MariaDB | Debian | 10.0 |
| Debian Jessie | MariaDB | Upstream | 10.0 / 10.1 / 10.2 / 10.3 |
| Debian Jessie | MariaDB Galera Cluster | Upstream | 10.1 / 10.2 |
| Debian Jessie | Percona server | Upstream | 5.5 / 5.6 / 5.7 |
| Debian Stretch | MariaDB | Debian | 10.1 | | Debian Stretch | MariaDB | Debian | 10.1 |
| Debian Stretch | MariaDB | Upstream | 10.1 / 10.2 / 10.3 | | Debian Stretch | MariaDB | Upstream | 10.1 / 10.2 / 10.3 |
| Debian Stretch | MariaDB Galera Cluster | Upstream | 10.1 / 10.2 | | Debian Stretch | MariaDB Galera Cluster | Upstream | 10.1 / 10.2 |
@ -19,9 +14,7 @@ Install and configure MySQL or MariaDB (Galera Cluster) or Percona Server. Manag
Notes Notes
----- -----
* MySQL 5.6 on Jessie needs backports repository
* MySQL server no longer exists on Debian Stretch * MySQL server no longer exists on Debian Stretch
* Percona Server is not available (soon?) on Debian Stretch
* Galera Cluster is experimental * Galera Cluster is experimental
* Due to Vagrant + Docker limitation (private network), replication/galera can't be checked with Travis * Due to Vagrant + Docker limitation (private network), replication/galera can't be checked with Travis
* If you need to test this role with Vagrant, you must install hostmanager plugin: `vagrant plugin install vagrant-hostmanager` * If you need to test this role with Vagrant, you must install hostmanager plugin: `vagrant plugin install vagrant-hostmanager`
@ -35,7 +28,7 @@ Role Variables
-------------- --------------
- `mysql_origin`: origin of the package ("default" or "upstream") - `mysql_origin`: origin of the package ("default" or "upstream")
- `mysql_vendor`: "mysql", "mariadb", "mariadb\_galera" (only with MariaDB upstream 10.1) or "percona" - `mysql_vendor`: "mariadb", "mariadb\_galera"
### Configuration ### Configuration
@ -67,7 +60,6 @@ Check "priv" syntax in [mysql\_user module documentation](http://docs.ansible.co
- `mysql_mariadb_version`: 10.0 / 10.1 / 10.2 - `mysql_mariadb_version`: 10.0 / 10.1 / 10.2
- `mysql_mariadb_repository`: MariaDB upstream APT repository (see: [MariaDB repositories tool](https://downloads.mariadb.org/mariadb/repositories)) - `mysql_mariadb_repository`: MariaDB upstream APT repository (see: [MariaDB repositories tool](https://downloads.mariadb.org/mariadb/repositories))
- `mysql_percona_version`: 5.5 / 5.6 / 5.7
- `mysql_percona_repository`: Percona upstream APT repository (see: [Percona APT doc](http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html)) - `mysql_percona_repository`: Percona upstream APT repository (see: [Percona APT doc](http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html))
- `mysql_use_percona_apt`: Force using Percona APT repository (useful when you want to use latest version of percona toolkits, xtrabackup... etc) - `mysql_use_percona_apt`: Force using Percona APT repository (useful when you want to use latest version of percona toolkits, xtrabackup... etc)
@ -94,7 +86,7 @@ Donation
If this code helped you, or if youve used them for your projects, feel free to buy me some :beers: If this code helped you, or if youve used them for your projects, feel free to buy me some :beers:
- Bitcoin: `1BQwhBeszzWbUTyK4aUyq3SRg7rBSHcEQn` - Bitcoin: `1BQwhBeszzWbUTyK4aUyq3SRg7rBSHcEQn`
- Ethereum: `63abe6b2648fd892816d87a31e3d9d4365a737b5` - Ethereum: `0x63abe6b2648fd892816d87a31e3d9d4365a737b5`
- Litecoin: `LeNDw34zQLX84VvhCGADNvHMEgb5QyFXyD` - Litecoin: `LeNDw34zQLX84VvhCGADNvHMEgb5QyFXyD`
- Monero: `45wbf7VdQAZS5EWUrPhen7Wo4hy7Pa7c7ZBdaWQSRowtd3CZ5vpVw5nTPphTuqVQrnYZC72FXDYyfP31uJmfSQ6qRXFy3bQ` - Monero: `45wbf7VdQAZS5EWUrPhen7Wo4hy7Pa7c7ZBdaWQSRowtd3CZ5vpVw5nTPphTuqVQrnYZC72FXDYyfP31uJmfSQ6qRXFy3bQ`

19
Vagrantfile vendored
View File

@ -5,9 +5,7 @@
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
vbox_deb_jessie = 'debian/jessie64'
vbox_deb_stretch = 'debian/stretch64' vbox_deb_stretch = 'debian/stretch64'
dk_deb_jessie = 'hanxhx/vagrant-ansible:debian8'
dk_deb_stretch = 'hanxhx/vagrant-ansible:debian9' dk_deb_stretch = 'hanxhx/vagrant-ansible:debian9'
config.hostmanager.enabled = true config.hostmanager.enabled = true
@ -17,27 +15,11 @@ Vagrant.configure("2") do |config|
config.hostmanager.include_offline = false config.hostmanager.include_offline = false
cases = [ cases = [
# Debian Jessie
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: dk_deb_jessie, vars: {mysql_origin: 'default', mysql_vendor: 'mysql' }, groups: ['master'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: nil, vars: {mysql_origin: 'default', mysql_vendor: 'mysql' }, groups: ['slave'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: dk_deb_jessie, vars: {mysql_origin: 'default', mysql_vendor: 'mariadb' }, groups: ['master'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: nil, vars: {mysql_origin: 'default', mysql_vendor: 'mariadb' }, groups: ['slave'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: dk_deb_jessie, vars: {mysql_origin: 'upstream', mysql_vendor: 'mariadb' }, groups: ['master'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: nil, vars: {mysql_origin: 'upstream', mysql_vendor: 'mariadb' }, groups: ['slave'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: dk_deb_jessie, vars: {mysql_origin: 'upstream', mysql_vendor: 'percona' }, groups: ['master'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: nil, vars: {mysql_origin: 'upstream', mysql_vendor: 'percona' }, groups: ['slave'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: dk_deb_jessie, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '1'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: nil, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '2'] },
{ os_name: 'jessie', vbox: vbox_deb_jessie, docker: nil, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '3'] },
# Debian Stretch # Debian Stretch
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'default', mysql_vendor: 'mysql' }, groups: ['master'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'default', mysql_vendor: 'mysql' }, groups: ['slave'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'default', mysql_vendor: 'mariadb' }, groups: ['master'] }, { os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'default', mysql_vendor: 'mariadb' }, groups: ['master'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'default', mysql_vendor: 'mariadb' }, groups: ['slave'] }, { os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'default', mysql_vendor: 'mariadb' }, groups: ['slave'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'upstream', mysql_vendor: 'mariadb' }, groups: ['master'] }, { os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'upstream', mysql_vendor: 'mariadb' }, groups: ['master'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'upstream', mysql_vendor: 'mariadb' }, groups: ['slave'] }, { os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'upstream', mysql_vendor: 'mariadb' }, groups: ['slave'] },
# { os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'upstream', mysql_vendor: 'percona' }, groups: ['master'] },
# { os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'upstream', mysql_vendor: 'percona' }, groups: ['slave'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '1'] }, { os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '1'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '2'] }, { os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '2'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '3'] }, { os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '3'] },
@ -49,6 +31,7 @@ Vagrant.configure("2") do |config|
ip = '192.168.201.' + iplsb.to_s ip = '192.168.201.' + iplsb.to_s
next if opts[:docker].nil? next if opts[:docker].nil?
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.define name do |m| config.vm.define name do |m|
m.vm.network "private_network", ip: ip m.vm.network "private_network", ip: ip
m.vm.provider "docker" do |d| m.vm.provider "docker" do |d|

View File

@ -49,7 +49,7 @@ mysql_thread_concurrency: "{{ ansible_processor_cores * 2 }}"
# InnoDB settings. # InnoDB settings.
mysql_innodb_file_per_table: '1' mysql_innodb_file_per_table: '1'
mysql_innodb_buffer_pool_size: "{{ (ansible_memtotal_mb * 0.2) | round | int }}M" mysql_innodb_buffer_pool_size: "{{ (ansible_memtotal_mb * 0.2) | round | int }}M"
mysql_innodb_log_file_size: "{% if ansible_distribution_release == 'jessie' and mysql_vendor == 'mysql' %}5M{% else %}64M{% endif %}" # If this setting changes on a running system, you will break it! http://dev.mysql.com/doc/refman/5.6/en/innodb-data-log-reconfiguration.html mysql_innodb_log_file_size: "64M" # If this setting changes on a running system, you will break it! http://dev.mysql.com/doc/refman/5.6/en/innodb-data-log-reconfiguration.html
mysql_innodb_log_buffer_size: '8M' mysql_innodb_log_buffer_size: '8M'
mysql_innodb_flush_log_at_trx_commit: '1' mysql_innodb_flush_log_at_trx_commit: '1'
mysql_innodb_lock_wait_timeout: 50 mysql_innodb_lock_wait_timeout: 50
@ -113,8 +113,6 @@ mysql_master_log_file: null
mysql_master_log_pos: null mysql_master_log_pos: null
# If true, reconfigure slave # If true, reconfigure slave
mysql_slave_force_setup: false mysql_slave_force_setup: false
# Only MariaDB 10.0+
mysql_gtid_domain_id: 1 mysql_gtid_domain_id: 1
# ------------------------------------- # -------------------------------------
@ -133,16 +131,17 @@ mysql_mariadb_repository: "http://{{ mysql_mariadb_mirror_domain }}/pub/mariadb/
mysql_mariadb_key_server: "keyserver.ubuntu.com" mysql_mariadb_key_server: "keyserver.ubuntu.com"
mysql_mariadb_key_ids: ['0xcbcb082a1bb943db', '0xf1656f24c74cd1d8'] mysql_mariadb_key_ids: ['0xcbcb082a1bb943db', '0xf1656f24c74cd1d8']
# -------------------------------------
# Galera
# -------------------------------------
mysql_galera_resetup: false
mysql_galera_members: []
mysql_galera_primary_node: 'change_me' # See: https://github.com/ansible/ansible/issues/17453
# ------------------------------------- # -------------------------------------
# Percona # Percona
# ------------------------------------- # -------------------------------------
mysql_percona_version: '5.6'
mysql_percona_repository: 'http://repo.percona.com/apt' mysql_percona_repository: 'http://repo.percona.com/apt'
mysql_use_percona_apt: false mysql_use_percona_apt: false
mysql_install_xtrabackup_package: false mysql_install_xtrabackup_package: false
mysql_xtrabackup_package: "{{ mysql_default_xtrabackup_package }}" mysql_xtrabackup_package: "{{ mysql_default_xtrabackup_package }}"
# Galera
mysql_galera_resetup: false
mysql_galera_members: []
mysql_galera_primary_node: 'change_me' # See: https://github.com/ansible/ansible/issues/17453

View File

@ -1,14 +1,13 @@
--- ---
galaxy_info: galaxy_info:
author: Emilien Mantel author: Emilien Mantel
description: Install and configure MySQL or MariaDB (Galera Cluster) or Percona server on Debian description: Install and configure MariaDB (and Galera Cluster) on Debian
company: company:
license: GPLv2 license: GPLv2
min_ansible_version: 2.3 min_ansible_version: 2.3
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- jessie
- stretch - stretch
galaxy_tags: galaxy_tags:
- database - database
@ -16,12 +15,10 @@ galaxy_info:
- packaging - packaging
- mysql - mysql
- mariadb - mariadb
- percona
- replication - replication
- debian - debian
- galera - galera
- cluster - cluster
- jessie
- stretch - stretch
dependencies: [] dependencies: []

View File

@ -1,25 +1,8 @@
--- ---
- name: FAIL | If config asked is impossible
fail: msg="config asked is impossible ({{ mysql_origin }} / {{ mysql_vendor }})"
when: >
not (
(mysql_origin == 'default' and mysql_vendor == 'mysql') or
(mysql_origin == 'default' and mysql_vendor == 'mariadb') or
(mysql_origin == 'upstream' and mysql_vendor == 'mariadb') or
(mysql_origin == 'upstream' and mysql_vendor == 'mariadb_galera') or
(mysql_origin == 'upstream' and mysql_vendor == 'percona')
)
- name: INCLUDE | Use Percona repository - name: INCLUDE | Use Percona repository
include: 'percona/apt.yml' include: 'percona/apt.yml'
when: > when: mysql_use_percona_apt
mysql_use_percona_apt and
not (mysql_origin == 'upstream' and mysql_vendor == 'percona')
- name: INCLUDE | Install MySQL from default repo
include: 'mysql/default.yml'
when: mysql_origin == 'default' and mysql_vendor == 'mysql'
- name: INCLUDE | Install MariaDB from Debian repo - name: INCLUDE | Install MariaDB from Debian repo
include: 'mariadb/default.yml' include: 'mariadb/default.yml'
@ -27,16 +10,15 @@
- name: INCLUDE | Install MariaDB from MariaDB repo - name: INCLUDE | Install MariaDB from MariaDB repo
include: 'mariadb/upstream.yml' include: 'mariadb/upstream.yml'
when: mysql_origin == 'upstream' and (mysql_vendor == 'mariadb' or mysql_vendor == 'mariadb_galera') when: mysql_origin == 'upstream'
- name: INCLUDE | Install Percona Server from Percona repo
include: 'percona/upstream.yml'
when: mysql_origin == 'upstream' and mysql_vendor == 'percona'
- name: APT | Install few MySQL related tools - name: APT | Install few MySQL related tools
apt: pkg={{ item }} state=present install_recommends=no apt:
pkg: "{{ item }}"
install_recommends: no
with_items: "{{ mysql_tools }}" with_items: "{{ mysql_tools }}"
- name: APT | Install percona-xtrabackup if needed - name: APT | Install percona-xtrabackup if needed
apt: pkg={{ mysql_xtrabackup_package }} apt:
pkg: "{{ mysql_xtrabackup_package }}"
when: mysql_install_xtrabackup_package when: mysql_install_xtrabackup_package

View File

@ -1,18 +0,0 @@
---
- name: SHELL | Get MySQL target version
shell: LANG=C apt-cache depends mysql-server | awk -F '-' '/Depends/ { print $NF }'
register: apt_mysql_version
changed_when: false
- name: DEBCONF | Prepare MySQL silent installation (root password)
debconf: name='mysql-server-{{ apt_mysql_version.stdout }}' question='mysql-server/root_password' vtype='password' value='{{ mysql_root_password }}'
when: not mysql_exists.stat.exists
- name: DEBCONF | Prepare MySQL silent installation (root password again)
debconf: name='mysql-server-{{ apt_mysql_version.stdout }}' question='mysql-server/root_password_again' vtype='password' value='{{ mysql_root_password }}'
when: not mysql_exists.stat.exists
- name: APT | Install MySQL server
apt: pkg=mysql-server state=present

View File

@ -1,16 +0,0 @@
---
- name: INCLUDE | Add percona APT repository
include: apt.yml
- name: DEBCONF | Prepare MySQL silent installation (root password)
debconf: name='percona-server-server-{{ mysql_percona_version }}' question='percona-server-server/root_password' vtype='password' value='{{ mysql_root_password }}'
when: not mysql_exists.stat.exists
- name: DEBCONF | Prepare MySQL silent installation (root password)
debconf: name='percona-server-server-{{ mysql_percona_version }}' question='percona-server-server/root_password_again' vtype='password' value='{{ mysql_root_password }}'
when: not mysql_exists.stat.exists
- name: APT | Install Percona
apt: update_cache=yes cache_valid_time=3600 pkg='percona-server-server-{{ mysql_percona_version }}' state=present

View File

@ -1,15 +1,5 @@
--- ---
- name: MYSQL_VARIABLES | Get MySQL vendor
mysql_variables: variable=version
register: vc
- name: SET_FACT | Server can use GTID
set_fact: mysql_gtid=true
when: >
( mysql_vendor == 'mariadb' and vc.msg | version_compare('10.0.2', 'ge') ) or
( mysql_vendor in ['mysql', 'percona'] and vc.msg | version_compare('5.6.5', 'ge') )
- name: INCLUDE | Replication Master - name: INCLUDE | Replication Master
include: master.yml include: master.yml
when: mysql_replication_master when: mysql_replication_master

View File

@ -38,7 +38,3 @@
- name: Configure MariaDB GTID - name: Configure MariaDB GTID
include: slave/mariadb_gtid.yml include: slave/mariadb_gtid.yml
when: >
mysql_vendor == 'mariadb' and
slave_status.Using_Gtid == 'No' and
mysql_gtid

View File

@ -11,10 +11,6 @@ log_bin = mysql-bin
log-bin-index = mysql-bin.index log-bin-index = mysql-bin.index
expire_logs_days = {{ mysql_expire_logs_days }} expire_logs_days = {{ mysql_expire_logs_days }}
max_binlog_size = {{ mysql_max_binlog_size }} max_binlog_size = {{ mysql_max_binlog_size }}
{% if mysql_vendor == 'mariadb' and mysql_gtid %}
# MariaDB only
gtid_domain_id={{ mysql_gtid_domain_id }} gtid_domain_id={{ mysql_gtid_domain_id }}
{% endif %}
; vim: set ft=dosini : ; vim: set ft=dosini :

View File

@ -18,6 +18,6 @@ Wait master fully installed before run slave.
Example: Example:
``` ```
vagrant up jessie-upstream-mariadb-master vagrant up stretch-upstream-mariadb-master
vagrant up jessie-upstream-mariadb-slave vagrant up stretch-upstream-mariadb-slave
``` ```

View File

@ -1,7 +0,0 @@
mysql_tools:
- mytop
- percona-toolkit
- python-mysqldb
- mysqltuner
mysql_default_xtrabackup_package: 'percona-xtrabackup'