daily pastebin goal
84%
SHARE
TWEET

Untitled

a guest Nov 9th, 2018 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. az login --service-principal -u "user" -p "secret" --tenant "tenant"
  2. IPLIST=`az vmss nic list --resource-group "example" --vmss-name "consul_srv" | jq '.[].ipConfigurations[].privateIpAddress' | sed '1,2s/\"$/\",/g'`
  3. IP=`ip a | grep 10.10 | awk '{print $2}' | rev | cut -c 4- | rev | head -1`
  4.  
  5. cat <<EOF > /etc/consul/server.json
  6. {
  7.     "server": true,
  8.     "datacenter": "dc1",
  9.     "domain": "azure",
  10.     "data_dir": "/var/consul",
  11.     "encrypt": "key",
  12.     "log_level": "INFO",
  13.     "enable_syslog": true,
  14.     "retry_join": [$IPLIST],
  15.     "ui": true,
  16.     "client_addr": "0.0.0.0",
  17.     "ports": {
  18.         "dns": 53
  19.     }
  20. }
  21. EOF
  22. /usr/local/bin/consul agent -config-dir /etc/consul/ -bind=$IP -bootstrap-expect=3 -pid-file=/var/run/consul.pid
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand