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.

28 lines
1009 B

  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 /usr/share/ca-certificates/:/etc/ssl/certs:ro \
  14. -v /var/lib/etcd:/var/lib/etcd:rw \
  15. --name={{ etcd_member_name | default("etcd") }} \
  16. {{ etcd_image_repo }}:{{ etcd_image_tag }} \
  17. {% if etcd_after_v3 %}
  18. {{ etcd_container_bin_dir }}etcd
  19. {% endif %}
  20. ExecStartPre=-{{ docker_bin_dir | default("/usr/bin") }}/docker rm -f {{ etcd_member_name | default("etcd-proxy") }}
  21. ExecReload={{ docker_bin_dir | default("/usr/bin") }}/docker restart {{ etcd_member_name | default("etcd-proxy") }}
  22. ExecStop={{ docker_bin_dir | default("/usr/bin") }}/docker stop {{ etcd_member_name | default("etcd-proxy") }}
  23. Restart=always
  24. RestartSec=15s
  25. [Install]
  26. WantedBy=multi-user.target