ansible-mysql/tasks/install/main.yml

51 lines
2.0 KiB
YAML
Raw Normal View History

---
2015-07-13 17:32:49 +07:00
- name: FAIL | If config asked is impossible
2015-08-09 02:34:17 +07:00
fail: msg="config asked is impossible origin -> {{ mysql_origin }} vendor -> {{ mysql_vendor }}"
2015-07-13 17:32:49 +07:00
when: >
not (
(mysql_origin == 'default' and mysql_vendor == 'mysql') or
(mysql_origin == 'default' and mysql_vendor == 'mariadb' and ansible_distribution_major_version > 7) or
2015-07-16 15:56:28 +07:00
(mysql_origin == 'upstream' and mysql_vendor == 'mariadb') or
(mysql_origin == 'upstream' and mysql_vendor == 'percona')
2015-07-13 17:32:49 +07:00
)
2015-08-07 21:43:24 +07:00
- name: APT_KEY | Install Percona key
apt_key: keyserver="keyserver.ubuntu.com" id="1C4CBDCDCD2EFD2A" state=present
#apt_key: keyserver="keys.gnupg.net" id="1C4CBDCDCD2EFD2A" state=present
#- 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: APT_REPOSITORY | Add Percona repository
apt_repository: repo='deb {{ percona_repository }} {{ ansible_distribution_release }} main' state=present
- name: APT_RESPOSITORY | Add Percona (src) repository
apt_repository: repo='deb-src {{ percona_repository }} {{ ansible_distribution_release }} main' state=present
2015-07-13 17:32:49 +07:00
- name: INCLUDE | Install MySQL from default repo
2015-08-21 14:40:44 +07:00
include: 'default_mysql.yml'
2015-07-12 17:47:44 +07:00
when: mysql_origin == 'default' and mysql_vendor == 'mysql'
- name: INCLUDE | Install MariaDB from Debian repo
2015-08-21 14:40:44 +07:00
include: 'default_mariadb.yml'
2015-07-13 17:32:49 +07:00
when: mysql_origin == 'default' and mysql_vendor == 'mariadb' and ansible_distribution_major_version > 7
- name: INCLUDE | Install MariaDB from MariaDB repo
2015-08-21 14:40:44 +07:00
include: 'upstream_mariadb.yml'
2015-07-16 15:56:28 +07:00
when: mysql_origin == 'upstream' and mysql_vendor == 'mariadb'
- name: INCLUDE | Install Percona Server from Percona repo
2015-08-21 14:40:44 +07:00
include: 'upstream_percona.yml'
2015-07-16 15:56:28 +07:00
when: mysql_origin == 'upstream' and mysql_vendor == 'percona'
- name: APT | Install few MySQL related tools
apt: pkg={{ item }} state=latest
with_items:
- mytop
- percona-toolkit
- python-mysqldb
2015-08-07 21:43:24 +07:00
- percona-xtrabackup
2015-08-21 06:00:44 +07:00
- mysqltuner