ansible-mysql/tasks/install/main.yml

45 lines
1.5 KiB
YAML

---
- name: FAIL | If config asked is impossible
fail: msg="config asked is impossible"
when: >
not (
(mysql_origin == 'default' and mysql_vendor == 'mysql') or
(mysql_origin == 'default' and mysql_vendor == 'mariadb' and ansible_distribution_major_version > 7) or
(mysql_origin == 'upstream' and mysql_vendor == 'mariadb') or
(mysql_origin == 'upstream' and mysql_vendor == 'percona')
)
- name: APT | Install Percona Xtrabackup
include: percona/apt.yml
when: mysql_use_percona_repository
- name: INCLUDE | Install MySQL from default repo
include: 'mysql/default.yml'
when: mysql_origin == 'default' and mysql_vendor == 'mysql'
- name: INCLUDE | Install MariaDB from Debian repo
include: 'mariadb/default.yml'
when: mysql_origin == 'default' and mysql_vendor == 'mariadb' and ansible_distribution_major_version > 7
- name: INCLUDE | Install MariaDB from MariaDB repo
include: 'mariadb/upstream.yml'
when: mysql_origin == 'upstream' and mysql_vendor == 'mariadb'
- name: INCLUDE | Install Percona Server from Percona repo
include: 'percona/upstream.yml'
when: mysql_origin == 'upstream' and mysql_vendor == 'percona'
- name: APT | Install few MySQL related tools
apt: pkg={{ item }} state=present
with_items:
- mytop
- percona-toolkit
- python-mysqldb
- mysqltuner
- name: APT | Install Percona Xtrabackup
apt: pkg=percona-xtrabackup state=present
when: ansible_distribution_major_version > 7 or mysql_use_percona_repository