forked from fauust/ansible-role-mariadb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.yml
38 lines (33 loc) · 1.07 KB
/
setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- name: Install mariadb repo necessary packages
apt:
package:
- software-properties-common
- dirmngr
state: present
update_cache: true
when: mariadb_use_official_repo
- name: Install mariadb repository key
apt_key:
keyserver: keyserver.ubuntu.com
id: "0xF1656F24C74CD1D8"
when: mariadb_use_official_repo
- name: Setup mariadb repository sourcelist entry
apt_repository:
repo: deb {{ mariadb_use_official_repo_url }}/{{ mariadb_use_official_repo_version }}/{{ ansible_distribution|lower() }} {{ ansible_distribution_release }} main
filename: mariadb
state: present
when: mariadb_use_official_repo
- name: Install mariadb
apt:
package:
- mariadb-server
state: present
update_cache: true
- name: Determine required MariaDB Python libraries
set_fact:
deb_mariadb_python_package: "{% if 'python3' in discovered_interpreter_python|default('') %}python3-pymysql{% else %}python-pymysql{% endif %}"
- name: Install python mariadb driver
apt:
name: "{{ deb_mariadb_python_package }}"
state: present