ansible-mysql/tasks/install.yml

39 lines
1.3 KiB
YAML
Raw Normal View History

---
2015-07-13 17:32:49 +07:00
- 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
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
)
- name: APT | Update cache
apt: update_cache=yes cache_valid_time=3600
- name: INCLUDE | Install MySQL from default repo
include: 'install_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
include: 'install_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-07-16 15:56:28 +07:00
include: 'install_upstream_mariadb.yml'
when: mysql_origin == 'upstream' and mysql_vendor == 'mariadb'
- name: INCLUDE | Install Percona Server from Percona repo
2015-07-16 15:56:28 +07:00
include: 'install_upstream_percona.yml'
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