Support Debian Buster (#34)

pull/40/head 1.1.0
Emilien M 2019-08-07 17:41:45 +02:00 committed by GitHub
parent 9871c214fc
commit dac586acbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 86 additions and 25 deletions

View File

@ -1,13 +1,20 @@
env:
- PLATFORM='docker-stretch-default-master' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-upstream-master' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-upstream-galera-1' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-default-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-upstream-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-default-galera-1' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-upstream-galera-1' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-buster-default-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-buster-upstream-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-buster-default-galera-1' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-buster-upstream-galera-1' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-default-master' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-stretch-upstream-master' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-stretch-default-galera-1' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-stretch-upstream-galera-1' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-buster-default-master' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-buster-upstream-master' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-buster-default-galera-1' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-buster-upstream-galera-1' ANSIBLE_VERSION='ansible>=2.7,<2.8'
sudo: required
@ -22,7 +29,7 @@ services:
before_install:
- wget https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.deb
- sudo dpkg -i vagrant_2.0.1_x86_64.deb
- vagrant plugin install vagrant-hostmanager
- vagrant plugin install vagrant-hostmanager
install:
- pip install "$ANSIBLE_VERSION"

View File

@ -9,6 +9,8 @@ Install and configure MariaDB (Galera Cluster). Manage replication (master/slave
| --------------- | --------- | ------------------------- |
| Debian Stretch | Debian | 10.1 |
| Debian Stretch | Upstream | 10.1 / 10.2 / 10.3 / 10.4 |
| Debian Buster | Debian | 10.3 |
| Debian Buster | Upstream | 10.3 / 10.4 |
Notes
-----
@ -16,6 +18,7 @@ Notes
* 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`
* Percona Xtrabackup is not available in upstream repository. This feature is disabled in the role.
Requirements
------------
@ -59,7 +62,7 @@ Check "priv" syntax in [mysql\_user module documentation](http://docs.ansible.co
### Packaging
- `mariadb_version`: 10.0 / 10.1 / 10.2 / 10.3
- `mariadb_version`: depends Debian version
- `mariadb_repository`: MariaDB upstream APT repository (see: [MariaDB repositories tool](https://downloads.mariadb.org/mariadb/repositories))
- `mariadb_percona_repository`: Percona upstream APT repository (see: [Percona APT doc](http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html))
- `mariadb_use_percona_apt`: Force using Percona APT repository (useful when you want to use latest version of percona toolkits, xtrabackup... etc)

37
Vagrantfile vendored
View File

@ -7,6 +7,8 @@ Vagrant.configure("2") do |config|
vbox_deb_stretch = 'debian/stretch64'
dk_deb_stretch = 'hanxhx/vagrant-ansible:debian9'
vbox_deb_buster = 'debian/buster64'
dk_deb_buster = 'hanxhx/vagrant-ansible:debian10'
config.hostmanager.enabled = true
config.hostmanager.manage_host = false
@ -15,14 +17,49 @@ Vagrant.configure("2") do |config|
config.hostmanager.include_offline = false
cases = [
# ========================
# Debian Stretch
# ========================
# Default replication
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mariadb_origin: 'default' }, groups: ['master'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'default' }, groups: ['slave'] },
# Upstream replication
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mariadb_origin: 'upstream' }, groups: ['master'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['slave'] },
# Galera Debian
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mariadb_origin: 'default' }, groups: ['galera', '1'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'default' }, groups: ['galera', '2'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'default' }, groups: ['galera', '3'] },
# Galera Upstream
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: dk_deb_stretch, vars: {mariadb_origin: 'upstream' }, groups: ['galera', '1'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['galera', '2'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['galera', '3'] },
# ========================
# Debian Buster
# ========================
# Default replication
{ os_name: 'buster', vbox: vbox_deb_buster, docker: dk_deb_buster, vars: {mariadb_origin: 'default' }, groups: ['master'] },
# { os_name: 'buster', vbox: vbox_deb_buster, docker: nil, vars: {mariadb_origin: 'default' }, groups: ['slave'] },
# Upstream replication
{ os_name: 'buster', vbox: vbox_deb_buster, docker: dk_deb_buster, vars: {mariadb_origin: 'upstream' }, groups: ['master'] },
# { os_name: 'buster', vbox: vbox_deb_buster, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['slave'] },
# Galera Debian
{ os_name: 'buster', vbox: vbox_deb_buster, docker: dk_deb_buster, vars: {mariadb_origin: 'default' }, groups: ['galera', '1'] },
{ os_name: 'buster', vbox: vbox_deb_buster, docker: nil, vars: {mariadb_origin: 'default' }, groups: ['galera', '2'] },
{ os_name: 'buster', vbox: vbox_deb_buster, docker: nil, vars: {mariadb_origin: 'default' }, groups: ['galera', '3'] },
# Galera Upstream
{ os_name: 'buster', vbox: vbox_deb_buster, docker: dk_deb_buster, vars: {mariadb_origin: 'upstream' }, groups: ['galera', '1'] },
{ os_name: 'buster', vbox: vbox_deb_buster, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['galera', '2'] },
{ os_name: 'buster', vbox: vbox_deb_buster, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['galera', '3'] },
]
cases.each_with_index do |opts,index|

View File

@ -124,7 +124,7 @@ mariadb_users: []
# -------------------------------------
# MariaDB
# -------------------------------------
mariadb_version: '10.1'
mariadb_version: '10.3'
mariadb_mirror_domain: "ftp.igh.cnrs.fr"
# See: https://downloads.mariadb.org/mariadb/repositories
mariadb_repository: "http://{{ mariadb_mirror_domain }}/pub/mariadb/repo/{{ mariadb_version }}/debian"

View File

@ -9,9 +9,9 @@ galaxy_info:
- name: Debian
versions:
- stretch
- buster
galaxy_tags:
- database
- database:sql
- packaging
- mysql
- mariadb

View File

@ -1,20 +1,16 @@
---
- name: APT_KEY | Install Percona key
apt_key:
keyserver: "keyserver.ubuntu.com"
id: "8507EFA5"
- name: APT | Install Percona repository
apt:
deb: https://repo.percona.com/apt/percona-release_latest.generic_all.deb
- name: TEMPLATE | Deploy APT pinning (prevent upgrades from Debian)
template:
src: etc/apt/preferences.d/95-percona.j2
dest: /etc/apt/preferences.d/95-percona
- name: COMMAND | Enable percona tools repository
command: percona-release enable tools release
args:
creates: /etc/apt/sources.list.d/percona-tools-release.list
register: p
- name: APT_REPOSITORY | Add Percona repository
apt_repository:
repo: 'deb {{ mariadb_percona_repository }} {{ ansible_distribution_release }} main'
- name: APT_RESPOSITORY | Add Percona (src) repository
apt_repository:
repo: 'deb-src {{ mariadb_percona_repository }} {{ ansible_distribution_release }} main'
when: mariadb_upstream_apt_src
- name: APT | Update cache
apt:
update_cache: yes
when: p.changed

View File

@ -1,5 +1,13 @@
---
- block:
- name: SET_FACT | Bypass https://github.com/ansible/ansible/issues/19874
set_fact:
ansible_distribution_release: 'buster'
when: ansible_facts.distribution_major_version == "buster/sid"
- name: INCLUDE_VARS | Related to OS version
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"

View File

@ -75,10 +75,14 @@
- hosts: galera
pre_tasks:
- name: SET_FACT | Bypass https://github.com/ansible/ansible/issues/19874
set_fact:
ansible_distribution_release: 'buster'
when: ansible_facts.distribution_major_version == "buster/sid"
- name: SET_FACT | Apply some configuration
set_fact:
mariadb_galera_primary_node: '{% if is_docker %}docker-{% else %}vbox-{% endif %}{{ ansible_distribution_release }}-upstream-galera-1'
mariadb_galera_primary_node: '{% if is_docker %}docker-{% else %}vbox-{% endif %}{{ ansible_distribution_release }}-{{ mariadb_origin }}-galera-1'
mariadb_wsrep_node_address: "{{ '127.0.0.1' if is_docker else ansible_eth1.ipv4.address }}"
mariadb_version: '10.1'
mariadb_version: '10.3'
roles:
- ../../

View File

@ -0,0 +1,6 @@
mariadb_tools:
- percona-toolkit
- python-mysqldb
- mysqltuner
mariadb_default_xtrabackup_package: 'percona-xtrabackup-24'