add MariaDB role
This commit is contained in:
36
roles/mariadb/tasks/mariadb.yml
Normal file
36
roles/mariadb/tasks/mariadb.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Add MariaDB GPG apt key
|
||||
apt_key:
|
||||
url: https://mariadb.org/mariadb_release_signing_key.asc
|
||||
keyring: /usr/share/keyrings/mariadb_release_signing_key.gpg
|
||||
state: present
|
||||
|
||||
- name: Add MariaDB Repository
|
||||
apt_repository:
|
||||
repo: "deb [arch={{ deb_architecture }} signed-by=/usr/share/keyrings/mariadb_release_signing_key.gpg] \
|
||||
https://mirrors.n-ix.net/mariadb/repo/{{ mariadb_server_version }}/ubuntu {{ ansible_distribution_release }} main/debug"
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Install MariaDB
|
||||
apt:
|
||||
name: mariadb-server
|
||||
state: latest
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Install required system packages
|
||||
apt:
|
||||
name: python3-mysqldb # needed for mariadb ansible module
|
||||
state: latest
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Copy configuration file
|
||||
template:
|
||||
src: my.cnf.j2
|
||||
dest: /etc/mysql/my.cnf
|
||||
owner: mysql
|
||||
group: mysql
|
||||
mode: 0600
|
||||
notify: restart mariadb
|
||||
Reference in New Issue
Block a user