32 lines
945 B
YAML
32 lines
945 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: '{{ mariadb_root_password }}'
|
|
when: not mariadb_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: '{{ mariadb_root_password }}'
|
|
when: not mariadb_exists.stat.exists
|
|
|
|
- name: APT | Install MariaDB server
|
|
apt:
|
|
pkg: mariadb-server
|
|
|
|
- name: APT | Install Galera
|
|
apt:
|
|
pkg: galera-3
|
|
when: mariadb_vendor == 'mariadb_galera'
|