Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- az login --service-principal -u "user" -p "secret" --tenant "tenant"
- IPLIST=`az vmss nic list --resource-group "example" --vmss-name "consul_srv" | jq '.[].ipConfigurations[].privateIpAddress' | sed '1,2s/\"$/\",/g'`
- IP=`ip a | grep 10.10 | awk '{print $2}' | rev | cut -c 4- | rev | head -1`
- cat <<EOF > /etc/consul/server.json
- {
- "server": true,
- "datacenter": "dc1",
- "domain": "azure",
- "data_dir": "/var/consul",
- "encrypt": "key",
- "log_level": "INFO",
- "enable_syslog": true,
- "retry_join": [$IPLIST],
- "ui": true,
- "client_addr": "0.0.0.0",
- "ports": {
- "dns": 53
- }
- }
- EOF
- /usr/local/bin/consul agent -config-dir /etc/consul/ -bind=$IP -bootstrap-expect=3 -pid-file=/var/run/consul.pid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement