24 lines
683 B
YAML
24 lines
683 B
YAML
|
# Install a docker based mariadb.
|
||
|
---
|
||
|
- name: Install a mariadb server with databases in a persistent volume
|
||
|
hosts: all # Should be specified of course
|
||
|
become: True
|
||
|
tasks:
|
||
|
- name: install docker packages
|
||
|
apt: pkg={{ item }} state=latest update_cache=yes
|
||
|
with_items:
|
||
|
- docker-engine
|
||
|
- name: install service file.
|
||
|
template:
|
||
|
src: files/mysql.service
|
||
|
dest: /etc/systemd/system/mysql.service
|
||
|
mode: 644
|
||
|
owner: root
|
||
|
group: root
|
||
|
- name: install service file
|
||
|
command: systemctl daemon-reload
|
||
|
- name: make sure service is started
|
||
|
systemd:
|
||
|
name: mariadb.service
|
||
|
state: started
|