Created
May 1, 2017 17:38
-
-
Save hickey/c4e17182bbb005d6d0a0f4b94f1878d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# extra args to put on the command line | |
extra_args="--debug " | |
if [ -n '{{ bind.has_backend }}' ]; then | |
init_adv_peer_urls='' | |
adv_client_urls='' | |
# build a list of all etcd servers for advertising | |
{{~#eachAlive bind.backend.members}} | |
init_adv_peer_urls="${init_adv_peer_urls},http://{{ip}}:2380" | |
adv_client_urls="${adv_client_urls},http://{{ip}}:2379" | |
{{~/eachAlive}} | |
# remove the comma at the beginning of the list | |
init_adv_peer_urls=${init_adv_peer_urls#,} | |
adv_client_urls=${adv_client_urls#,} | |
extra_args="--initial-advertise-peer-urls '${init_adv_peer_urls}' --advertise-client-urls '${adv_client_urls}' ${extra_args}" | |
else | |
extra_args="--initial-advertise-peer-urls 'http://{{sys.ip}}:2380' --advertise-client-urls 'http://{{sys.ip}}:2379' ${extra_args}" | |
fi | |
echo "{{pkg.path}}/bin/etcd --config-file {{pkg.svc_config_path}}/etcd.conf.yml ${extra_args}" | |
{{pkg.path}}/bin/etcd --config-file {{pkg.svc_config_path}}/etcd.conf.yml ${extra_args} | |
echo "etcd exited with status $?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment