ansible-mysql/tasks/install/main.yml

43 lines
1.5 KiB
YAML

---
- name: FAIL | If config asked is impossible
fail: msg="config asked is impossible ({{ mysql_origin }} / {{ mysql_vendor }})"
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: 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'
- 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 install_recommends=no
with_items: "{{ mysql_tools }}"
- name: APT | Install percona-xtrabackup if needed
apt: pkg={{ mysql_xtrabackup_package }}
when: mysql_install_xtrabackup_package