ansible-mysql/tasks/install.yml

39 lines
1.3 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 == 'mariadb' and mysql_vendor == 'mariadb') or
(mysql_origin == 'percona' and mysql_vendor == 'percona')
)
- name: APT | Update cache
apt: update_cache=yes cache_valid_time=3600
- name: INCLUDE | Install MySQL from default repo
include: 'install_default_mysql.yml'
when: mysql_origin == 'default' and mysql_vendor == 'mysql'
- name: INCLUDE | Install MariaDB from Debian repo
include: 'install_default_mariadb.yml'
when: mysql_origin == 'default' and mysql_vendor == 'mariadb' and ansible_distribution_major_version > 7
- name: INCLUDE | Install MariaDB from MariaDB repo
include: 'install_mariadb_mariadb.yml'
when: mysql_origin == 'mariadb' and mysql_vendor == 'mariadb'
- name: INCLUDE | Install Percona Server from Percona repo
include: 'install_percona_percona.yml'
when: mysql_origin == 'percona' and mysql_vendor == 'percona'
- name: APT | Install few MySQL related tools
apt: pkg={{ item }} state=latest
with_items:
- mytop
- percona-toolkit
- python-mysqldb