Skip to content

Instantly share code, notes, and snippets.

@kelseyhightower
Created February 14, 2015 21:05
Show Gist options
  • Select an option

  • Save kelseyhightower/e07477f44364c9694c59 to your computer and use it in GitHub Desktop.

Select an option

Save kelseyhightower/e07477f44364c9694c59 to your computer and use it in GitHub Desktop.
- name: etcd.service
command: start
content: |
[Unit]
Description=etcd
[Service]
User=etcd
PermissionsStartOnly=true
ExecStartPre=/usr/bin/wget -N -P /opt/bin http://192.168.0.1/etcd
ExecStartPre=/usr/bin/wget -N -P /opt/bin http://192.168.0.1/etcdctl
ExecStartPre=/usr/bin/chmod +x /opt/bin/etcd
ExecStartPre=/usr/bin/chmod +x /opt/bin/etcdctl
ExecStart=/opt/bin/etcd \
-name etcd0 \
-data-dir /var/lib/etcd \
-advertise-client-urls http://192.168.12.10:2379 \
-listen-client-urls http://192.168.12.10:2379 \
-initial-advertise-peer-urls http://192.168.12.10:2380 \
-listen-peer-urls http://192.168.12.10:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://192.168.12.10:2380 \
-initial-cluster-state new
Restart=always
RestartSec=10s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment