2017-04-25 14:47:04 +02:00
|
|
|
# Install a docker based mariadb.
|
|
|
|
---
|
2017-08-14 16:40:06 +02:00
|
|
|
- name: include secrets
|
|
|
|
include_vars:
|
|
|
|
file: ../../secrets.yml
|
|
|
|
name: secrets
|
|
|
|
|
2017-04-25 14:47:04 +02:00
|
|
|
- name: install service file.
|
|
|
|
template:
|
2017-08-14 16:40:06 +02:00
|
|
|
src: templates/mysql.service
|
2017-04-25 14:47:04 +02:00
|
|
|
dest: /etc/systemd/system/mysql.service
|
|
|
|
mode: 644
|
|
|
|
owner: root
|
|
|
|
group: root
|
2017-06-22 09:19:08 +02:00
|
|
|
|
2017-09-29 16:40:38 +02:00
|
|
|
- name: start service at boot.
|
|
|
|
command: systemctl reenable mysql.service
|
|
|
|
|
2017-06-22 09:19:08 +02:00
|
|
|
- name: make mariadb settings volume
|
|
|
|
file:
|
2017-08-02 15:22:10 +02:00
|
|
|
path: "{{ item }}"
|
2017-06-22 09:19:08 +02:00
|
|
|
state: directory
|
|
|
|
mode: 0777
|
2017-08-02 15:22:10 +02:00
|
|
|
with_items:
|
|
|
|
- /srv/mariadb/lib/mysql
|
|
|
|
- /srv/mariadb/etc/mysql
|
2017-06-22 09:19:08 +02:00
|
|
|
|
|
|
|
- name: place settings file
|
|
|
|
copy:
|
|
|
|
src: files/my.cnf
|
|
|
|
dest: /srv/mariadb/etc/mysql
|
|
|
|
mode: 660
|
|
|
|
|
|
|
|
- command: systemctl daemon-reload
|
|
|
|
|
2017-04-25 14:47:04 +02:00
|
|
|
- name: make sure service is started
|
|
|
|
systemd:
|
|
|
|
name: mysql.service
|
|
|
|
state: started
|