How to configure ETCD snap on 18.04.3


#1

Is there a way to configure the etcd snap with a systemd unit file like the one below?

user@host:~$ cat  /etc/systemd/system/etcd.service

[Unit]
Description=etcd service
Documentation=https://github.com/etcd-io/etcd

[Service]
Type=notify
User=etcd
ExecStart=/usr/local/bin/etcd \\
  --name ${ETCD_NAME} \\
  --data-dir=/var/lib/etcd \\
  --initial-advertise-peer-urls http://${ETCD_HOST_IP}:2380 \\
  --listen-peer-urls http://${ETCD_HOST_IP}:2380 \\
  --listen-client-urls http://${ETCD_HOST_IP}:2379,http://127.0.0.1:2379 \\
  --advertise-client-urls http://${ETCD_HOST_IP}:2379 \\
  --initial-cluster-token etcd-cluster-0 \\
  --initial-cluster etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380 \\
  --initial-cluster-state new \

[Install]
WantedBy=multi-user.target

#2

After following this tutorial https://tutorials.ubuntu.com/tutorial/advanced-snap-usage#0
snap services can be managed with systemctl commands if desired.

snap services are found at /etc/systemd/system/ etcd service is named snap.etcd.etcd.service

etcd service looks for config.yml at /var/snap/etcd/common/etcd.conf.yml
example config http://github.com/markshuttle/etcd-snaps/blob/master/etcd-3.2/etcd.conf.yml.sample