33 lines
972 B
YAML
33 lines
972 B
YAML
|
---
|
||
|
|
||
|
- name: INCLUDE_VARS | Related to Debian version
|
||
|
include_vars: "{{ ansible_distribution_release }}.yml"
|
||
|
|
||
|
- name: FAIL | Check if packet is available
|
||
|
fail: msg='IMPOSSIBLE'
|
||
|
when: not "{{ mysql_origin }}_{{ mysql_vendor }}"
|
||
|
|
||
|
- name: STAT | Check if mysql exists
|
||
|
stat: path=/etc/init.d/mysql
|
||
|
register: mysql_exists
|
||
|
changed_when: false
|
||
|
|
||
|
- name: TEMPLATE | Deploy daemon configuration
|
||
|
template: src=etc/mysql/conf.d/98-config.cnf.j2 dest=/etc/mysql/conf.d/98-config.cnf
|
||
|
notify: restart mysql
|
||
|
|
||
|
- name: TEMPLATE Create .my.cnf for root
|
||
|
template: src=root/my.cnf dest=/root/.my.cnf owner=root group=root mode=0600 backup=yes
|
||
|
|
||
|
- name: INCLUDE | Secure install
|
||
|
include: 'secure.yml'
|
||
|
|
||
|
- name: MYSQL_DB | Create databases
|
||
|
mysql_db: name={{ item }} state=present
|
||
|
with_items: mysql_databases
|
||
|
|
||
|
- name: MYSQL_USER | Manages users...
|
||
|
mysql_user: name={{ item.name }} password={{ item.password }} priv={{ item.priv }} state=present
|
||
|
with_items: mysql_users
|
||
|
|