hpc-cloud/roles/mariadb/templates/mysql.service

19 lines
512 B
SYSTEMD
Raw Normal View History

2017-04-18 13:17:32 +02:00
[Unit]
Description=Mariadb Container
After=docker.service
Requires=docker.service
2017-04-18 13:17:32 +02:00
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker kill %n || /bin/true
2017-04-18 13:17:32 +02:00
ExecStartPre=-/usr/bin/docker rm %n
2017-06-02 12:00:19 +02:00
ExecStartPre=/usr/bin/docker pull mariadb:10.2
ExecStart=/usr/bin/docker run -p 3306:3306 --name %n \
-v /srv/mariadb/lib/mysql:/var/lib/mysql \
-v /srv/mariadb/etc/mysql:/etc/mysql \
-e MYSQL_ROOT_PASSWORD={{ secrets['MYSQL_ROOT_PASSWORD'] }} mariadb:10.2
2017-04-18 13:17:32 +02:00
[Install]
WantedBy=multi-user.target