hpc-cloud/roles/mariadb/templates/mysql.service
Egon Rijpkema fe708539f0 made environment file for the service.
I am unable to reproduce systemctl set-environment to work as
advertized.
2017-10-18 17:11:23 +02:00

22 lines
681 B
Desktop File

[Unit]
Description=Mariadb Container
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
EnvironmentFile=/srv/mariadb/systemd_environment
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 \
${MYSQLD_OPTS} ${_WSREP_NEW_CLUSTER} ${_WSREP_START_POSITION}
[Install]
WantedBy=multi-user.target