hpc-cloud/roles/mariadb/templates/mysql.service
Egon Rijpkema cc9d780fbc Reverted to updating init file by ansible.
entrypoint.sh of the mariadb container seems unable to cope when a blank
variable is passed by systemd.
2017-10-20 08:57:25 +02:00

20 lines
586 B
Desktop File

[Unit]
Description=Mariadb Container
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker kill %n || /bin/true
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull mariadb:10.2
ExecStart=/usr/bin/docker run --name %n \
-p 3306:3306 -p 4567:4567 -p 4568:4568 -p 4444:4444 \
-v /srv/mariadb/lib/mysql:/var/lib/mysql \
-v /srv/mariadb/etc/mysql/conf.d:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD={{ secrets['MYSQL_ROOT_PASSWORD'] }} mariadb:10.2 {{ mariadb_args }}
[Install]
WantedBy=multi-user.target