Drop MySQL, Percona Server and Jessie support
parent
589754e618
commit
859bafdb50
|
@ -1,17 +1,10 @@
|
|||
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-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4'
|
||||
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4'
|
||||
|
||||
matrix:
|
||||
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'
|
||||
fast_finish: true
|
||||
|
||||
|
|
12
README.md
12
README.md
|
@ -7,11 +7,6 @@ Install and configure MySQL or MariaDB (Galera Cluster) or Percona Server. Manag
|
|||
|
||||
| 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 | Upstream | 10.1 / 10.2 / 10.3 |
|
||||
| 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
|
||||
-----
|
||||
|
||||
* MySQL 5.6 on Jessie needs backports repository
|
||||
* MySQL server no longer exists on Debian Stretch
|
||||
* Percona Server is not available (soon?) on Debian Stretch
|
||||
* Galera Cluster is experimental
|
||||
* 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`
|
||||
|
@ -35,7 +28,7 @@ Role Variables
|
|||
--------------
|
||||
|
||||
- `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
|
||||
|
||||
|
@ -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_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_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 you’ve used them for your projects, feel free to buy me some :beers:
|
||||
|
||||
- Bitcoin: `1BQwhBeszzWbUTyK4aUyq3SRg7rBSHcEQn`
|
||||
- Ethereum: `63abe6b2648fd892816d87a31e3d9d4365a737b5`
|
||||
- Ethereum: `0x63abe6b2648fd892816d87a31e3d9d4365a737b5`
|
||||
- Litecoin: `LeNDw34zQLX84VvhCGADNvHMEgb5QyFXyD`
|
||||
- Monero: `45wbf7VdQAZS5EWUrPhen7Wo4hy7Pa7c7ZBdaWQSRowtd3CZ5vpVw5nTPphTuqVQrnYZC72FXDYyfP31uJmfSQ6qRXFy3bQ`
|
||||
|
||||
|
|
|
@ -5,9 +5,7 @@
|
|||
|
||||
Vagrant.configure("2") do |config|
|
||||
|
||||
vbox_deb_jessie = 'debian/jessie64'
|
||||
vbox_deb_stretch = 'debian/stretch64'
|
||||
dk_deb_jessie = 'hanxhx/vagrant-ansible:debian8'
|
||||
dk_deb_stretch = 'hanxhx/vagrant-ansible:debian9'
|
||||
|
||||
config.hostmanager.enabled = true
|
||||
|
@ -17,27 +15,11 @@ Vagrant.configure("2") do |config|
|
|||
config.hostmanager.include_offline = false
|
||||
|
||||
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
|
||||
{ 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: 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: 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: nil, vars: {mysql_origin: 'upstream' }, groups: ['mariadbgalera', '2'] },
|
||||
{ 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
|
||||
next if opts[:docker].nil?
|
||||
|
||||
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
config.vm.define name do |m|
|
||||
m.vm.network "private_network", ip: ip
|
||||
m.vm.provider "docker" do |d|
|
||||
|
|
|
@ -49,7 +49,7 @@ mysql_thread_concurrency: "{{ ansible_processor_cores * 2 }}"
|
|||
# InnoDB settings.
|
||||
mysql_innodb_file_per_table: '1'
|
||||
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_flush_log_at_trx_commit: '1'
|
||||
mysql_innodb_lock_wait_timeout: 50
|
||||
|
@ -113,8 +113,6 @@ mysql_master_log_file: null
|
|||
mysql_master_log_pos: null
|
||||
# If true, reconfigure slave
|
||||
mysql_slave_force_setup: false
|
||||
|
||||
# Only MariaDB 10.0+
|
||||
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_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
|
||||
# -------------------------------------
|
||||
mysql_percona_version: '5.6'
|
||||
mysql_percona_repository: 'http://repo.percona.com/apt'
|
||||
mysql_use_percona_apt: false
|
||||
mysql_install_xtrabackup_package: false
|
||||
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
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
---
|
||||
galaxy_info:
|
||||
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:
|
||||
license: GPLv2
|
||||
min_ansible_version: 2.3
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
- jessie
|
||||
- stretch
|
||||
galaxy_tags:
|
||||
- database
|
||||
|
@ -16,12 +15,10 @@ galaxy_info:
|
|||
- packaging
|
||||
- mysql
|
||||
- mariadb
|
||||
- percona
|
||||
- replication
|
||||
- debian
|
||||
- galera
|
||||
- cluster
|
||||
- jessie
|
||||
- stretch
|
||||
dependencies: []
|
||||
|
||||
|
|
|
@ -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
|
||||
include: 'percona/apt.yml'
|
||||
when: >
|
||||
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'
|
||||
when: mysql_use_percona_apt
|
||||
|
||||
- name: INCLUDE | Install MariaDB from Debian repo
|
||||
include: 'mariadb/default.yml'
|
||||
|
@ -27,16 +10,15 @@
|
|||
|
||||
- name: INCLUDE | Install MariaDB from MariaDB repo
|
||||
include: 'mariadb/upstream.yml'
|
||||
when: mysql_origin == 'upstream' and (mysql_vendor == 'mariadb' or mysql_vendor == 'mariadb_galera')
|
||||
|
||||
- name: INCLUDE | Install Percona Server from Percona repo
|
||||
include: 'percona/upstream.yml'
|
||||
when: mysql_origin == 'upstream' and mysql_vendor == 'percona'
|
||||
when: mysql_origin == 'upstream'
|
||||
|
||||
- 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 }}"
|
||||
|
||||
- name: APT | Install percona-xtrabackup if needed
|
||||
apt: pkg={{ mysql_xtrabackup_package }}
|
||||
apt:
|
||||
pkg: "{{ mysql_xtrabackup_package }}"
|
||||
when: mysql_install_xtrabackup_package
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
include: master.yml
|
||||
when: mysql_replication_master
|
||||
|
|
|
@ -38,7 +38,3 @@
|
|||
|
||||
- name: Configure MariaDB GTID
|
||||
include: slave/mariadb_gtid.yml
|
||||
when: >
|
||||
mysql_vendor == 'mariadb' and
|
||||
slave_status.Using_Gtid == 'No' and
|
||||
mysql_gtid
|
||||
|
|
|
@ -11,10 +11,6 @@ log_bin = mysql-bin
|
|||
log-bin-index = mysql-bin.index
|
||||
expire_logs_days = {{ mysql_expire_logs_days }}
|
||||
max_binlog_size = {{ mysql_max_binlog_size }}
|
||||
|
||||
{% if mysql_vendor == 'mariadb' and mysql_gtid %}
|
||||
# MariaDB only
|
||||
gtid_domain_id={{ mysql_gtid_domain_id }}
|
||||
{% endif %}
|
||||
|
||||
; vim: set ft=dosini :
|
||||
|
|
|
@ -18,6 +18,6 @@ Wait master fully installed before run slave.
|
|||
Example:
|
||||
|
||||
```
|
||||
vagrant up jessie-upstream-mariadb-master
|
||||
vagrant up jessie-upstream-mariadb-slave
|
||||
vagrant up stretch-upstream-mariadb-master
|
||||
vagrant up stretch-upstream-mariadb-slave
|
||||
```
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
mysql_tools:
|
||||
- mytop
|
||||
- percona-toolkit
|
||||
- python-mysqldb
|
||||
- mysqltuner
|
||||
|
||||
mysql_default_xtrabackup_package: 'percona-xtrabackup'
|
Loading…
Reference in New Issue