You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.0 KiB

  1. [Unit]
  2. Description=etcd docker wrapper
  3. Wants=docker.socket
  4. After=docker.service
  5. [Service]
  6. User=root
  7. PermissionsStartOnly=true
  8. ExecStart={{ docker_bin_dir | default("/usr/bin") }}/docker run --restart=always \
  9. --env-file=/etc/etcd.env \
  10. {# TODO(mattymo): Allow docker IP binding and disable in envfile
  11. -p 2380:2380 -p 2379:2379 #}
  12. --net=host \
  13. -v /etc/ssl/certs:/etc/ssl/certs:ro \
  14. -v {{ etcd_cert_dir }}:{{ etcd_cert_dir }}:ro \
  15. -v /var/lib/etcd:/var/lib/etcd:rw \
  16. --name={{ etcd_member_name | default("etcd") }} \
  17. {{ etcd_image_repo }}:{{ etcd_image_tag }} \
  18. {% if etcd_after_v3 %}
  19. {{ etcd_container_bin_dir }}etcd
  20. {% endif %}
  21. ExecStartPre=-{{ docker_bin_dir | default("/usr/bin") }}/docker rm -f {{ etcd_member_name | default("etcd-proxy") }}
  22. ExecReload={{ docker_bin_dir | default("/usr/bin") }}/docker restart {{ etcd_member_name | default("etcd-proxy") }}
  23. ExecStop={{ docker_bin_dir | default("/usr/bin") }}/docker stop {{ etcd_member_name | default("etcd-proxy") }}
  24. Restart=always
  25. RestartSec=15s
  26. [Install]
  27. WantedBy=multi-user.target