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

19 lines
807 B
YAML

---
- name: SHELL | Get MariaDB target version
shell: LANG=C apt-cache depends mariadb-server | awk -F '-' '/Depends/ { print $NF }'
register: apt_mariadb_version
changed_when: false
- name: DEBCONF | Prepare MariaDB silent installation (root password)
debconf: name='mariadb-server-{{ apt_mariadb_version.stdout }}' question='mysql-server/root_password' vtype='password' value='{{ mysql_root_password }}'
when: not mysql_exists.stat.exists
- name: DEBCONF | Prepare MariaDB silent installation (root password again)
debconf: name='mariadb-server-{{ apt_mariadb_version.stdout }}' question='mysql-server/root_password_again' vtype='password' value='{{ mysql_root_password }}'
when: not mysql_exists.stat.exists
- name: APT | Install MariaDB server
apt: pkg=mariadb-server state=present