ansible-mysql/tasks/install/main.yml

44 lines
1.4 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') or
(mysql_origin == 'upstream' and mysql_vendor == 'mariadb') or
(mysql_origin == 'upstream' and mysql_vendor == 'mariadb_galera') 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'
- name: INCLUDE | Install MariaDB from MariaDB repo
include: 'mariadb/upstream.yml'
when: mysql_origin == 'upstream' and (mysql_vendor == 'mariadb' or mysql_vendor == 'mariadb_galera')
- 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