From 0f1d2bcdcf351cf6f8222ec8f0fa2b6e8caf130f Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Thu, 1 Jun 2017 15:56:08 +0200 Subject: [PATCH] Auto install percona apt repos if needed --- README.md | 1 + defaults/main.yml | 2 +- tasks/install/main.yml | 6 ++++++ tests/group_vars/all | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d8fd42..4e8de3a 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Check "priv" syntax in [mysql\_user module documentation](http://docs.ansible.co - `mysql_mariadb_repository`: MariaDB upstream APT repository (see: [MariaDB repositories tool](http://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) Dependencies ------------ diff --git a/defaults/main.yml b/defaults/main.yml index 9071f82..341eb24 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -133,7 +133,7 @@ mysql_mariadb_repository: "http://ftp.igh.cnrs.fr/pub/mariadb/repo/{{ mysql_mari # ------------------------------------- mysql_percona_version: '5.6' mysql_percona_repository: 'http://repo.percona.com/apt' - +mysql_use_percona_apt: false # Galera mysql_galera_resetup: false diff --git a/tasks/install/main.yml b/tasks/install/main.yml index f404112..28d6561 100644 --- a/tasks/install/main.yml +++ b/tasks/install/main.yml @@ -11,6 +11,12 @@ (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' diff --git a/tests/group_vars/all b/tests/group_vars/all index a728730..71d3a78 100644 --- a/tests/group_vars/all +++ b/tests/group_vars/all @@ -1,3 +1,4 @@ mysql_bind_address: '{{ ansible_eth1.ipv4.address }}' mysql_extra_configuration: innodb_commit_concurrency: 0 +mysql_use_percona_apt: true