2015-07-12 16:50:23 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: SHELL | Get MySQL target version
|
|
|
|
shell: LANG=C apt-cache depends mysql-server | awk -F '-' '/Depends/ { print $NF }'
|
2015-07-13 17:32:49 +07:00
|
|
|
register: apt_mysql_version
|
2015-07-12 16:50:23 +07:00
|
|
|
changed_when: false
|
|
|
|
|
2015-07-13 17:32:49 +07:00
|
|
|
- name: DEBCONF | Prepare MySQL silent installation (root password)
|
|
|
|
debconf: name='mysql-server-{{ apt_mysql_version.stdout }}' question='mysql-server/root_password' vtype='password' value='{{ mysql_root_password }}'
|
2015-07-12 16:50:23 +07:00
|
|
|
when: not mysql_exists.stat.exists
|
|
|
|
|
2015-08-08 18:44:08 +07:00
|
|
|
- name: DEBCONF | Prepare MySQL silent installation (root password again)
|
2015-07-13 17:32:49 +07:00
|
|
|
debconf: name='mysql-server-{{ apt_mysql_version.stdout }}' question='mysql-server/root_password_again' vtype='password' value='{{ mysql_root_password }}'
|
2015-07-12 16:50:23 +07:00
|
|
|
when: not mysql_exists.stat.exists
|
|
|
|
|
|
|
|
- name: APT | Install MySQL server
|
2015-08-21 21:16:10 +07:00
|
|
|
apt: pkg=mysql-server state=present
|
2015-07-12 16:50:23 +07:00
|
|
|
|