ansible-mysql/tasks/install/mysql/default.yml

19 lines
785 B
YAML
Raw Normal View History

---
- 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
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 }}'
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 }}'
when: not mysql_exists.stat.exists
- name: APT | Install MySQL server
apt: pkg=mysql-server state=present