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.

33 lines
1.1 KiB

  1. [Unit]
  2. Description=etcd docker wrapper
  3. Requires=docker.service
  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-proxy") }} \
  16. {{ etcd_image_repo }}:{{ etcd_image_tag }} \
  17. {% if etcd_after_v3 %}
  18. {{ etcd_container_bin_dir }}etcd \
  19. {% endif %}
  20. {% if is_etcd_master %}
  21. --proxy off
  22. {% else %}
  23. --proxy on
  24. {% endif %}
  25. ExecStartPre=-{{ docker_bin_dir | default("/usr/bin") }}/docker rm -f {{ etcd_member_name | default("etcd-proxy") }}
  26. ExecReload={{ docker_bin_dir | default("/usr/bin") }}/docker restart {{ etcd_member_name | default("etcd-proxy") }}
  27. ExecStop={{ docker_bin_dir | default("/usr/bin") }}/docker stop {{ etcd_member_name | default("etcd-proxy") }}
  28. Restart=always
  29. RestartSec=10s
  30. [Install]
  31. WantedBy=multi-user.target