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: 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-default-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-stretch-upstream-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-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-default-master' ANSIBLE_VERSION='ansible>=2.7,<2.8'
- PLATFORM='docker-stretch-upstream-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-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 sudo: required

View File

@ -9,6 +9,8 @@ Install and configure MariaDB (Galera Cluster). Manage replication (master/slave
| --------------- | --------- | ------------------------- | | --------------- | --------- | ------------------------- |
| Debian Stretch | Debian | 10.1 | | Debian Stretch | Debian | 10.1 |
| Debian Stretch | Upstream | 10.1 / 10.2 / 10.3 / 10.4 | | Debian Stretch | Upstream | 10.1 / 10.2 / 10.3 / 10.4 |
| Debian Buster | Debian | 10.3 |
| Debian Buster | Upstream | 10.3 / 10.4 |
Notes Notes
----- -----
@ -16,6 +18,7 @@ Notes
* 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`
* Percona Xtrabackup is not available in upstream repository. This feature is disabled in the role.
Requirements Requirements
------------ ------------
@ -59,7 +62,7 @@ Check "priv" syntax in [mysql\_user module documentation](http://docs.ansible.co
### Packaging ### 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_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_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) - `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' vbox_deb_stretch = 'debian/stretch64'
dk_deb_stretch = 'hanxhx/vagrant-ansible:debian9' 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.enabled = true
config.hostmanager.manage_host = false config.hostmanager.manage_host = false
@ -15,14 +17,49 @@ Vagrant.configure("2") do |config|
config.hostmanager.include_offline = false config.hostmanager.include_offline = false
cases = [ cases = [
# ========================
# Debian Stretch # 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: dk_deb_stretch, vars: {mariadb_origin: 'default' }, groups: ['master'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'default' }, groups: ['slave'] }, { 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: dk_deb_stretch, vars: {mariadb_origin: 'upstream' }, groups: ['master'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['slave'] }, { 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: 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', '2'] },
{ os_name: 'stretch', vbox: vbox_deb_stretch, docker: nil, vars: {mariadb_origin: 'upstream' }, groups: ['galera', '3'] }, { 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| cases.each_with_index do |opts,index|

View File

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

View File

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

View File

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

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 - name: INCLUDE_VARS | Related to OS version
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml" include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"

View File

@ -75,10 +75,14 @@
- hosts: galera - hosts: galera
pre_tasks: 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 - name: SET_FACT | Apply some configuration
set_fact: 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_wsrep_node_address: "{{ '127.0.0.1' if is_docker else ansible_eth1.ipv4.address }}"
mariadb_version: '10.1' mariadb_version: '10.3'
roles: roles:
- ../../ - ../../

View File

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