File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
consul-resources/templates Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 11consul = "{{ env "CONSUL_HOSTNAME" }}:{{ env "CONSUL_PORT" }}"
22
33vault {
4- address = "http://{{ env "CONSUL_HOSTNAME " }}:8200 "
4+ address = "http://{{ env "VAULT_HOSTNAME " }}:{{ env "VAULT_PORT" }} "
55 token = "{{ env "VAULT_TOKEN" }}"
66 renew = false
77}
Original file line number Diff line number Diff line change 66
77export DOCK_INIT_BASE=/opt/runnable/dock-init
88export HOST_IP=$( hostname -i)
9+ source " ${DOCK_INIT_BASE} /lib/util/log.sh"
910
1011if [ -z " ${CONSUL_PORT+x} " ]; then
1112 export CONSUL_PORT=8500
1415fi
1516
1617if [ -z " ${CONSUL_HOSTNAME+x} " ]; then
17- export CONSUL_HOSTNAME=10.4.5.144
18+ log::fatal " CONSUL_HOSTNAME is not defined"
19+ exit 1
1820else
1921 export CONSUL_HOSTNAME
2022fi
2123
24+ if [ -z " ${VAULT_PORT+x} " ]; then
25+ export VAULT_PORT=8200
26+ else
27+ export VAULT_PORT
28+ fi
29+
30+ if [ -z " ${VAULT_HOSTNAME+x} " ]; then
31+ export VAULT_HOSTNAME=$CONSUL_HOSTNAME
32+ else
33+ export VAULT_HOSTNAME
34+ fi
35+
2236export DOCKER_NETWORK=172.17.0.0/16
2337
2438source " ${DOCK_INIT_BASE} /lib/consul.sh"
2539source " ${DOCK_INIT_BASE} /lib/aws.sh"
2640source " ${DOCK_INIT_BASE} /lib/dock.sh"
2741source " ${DOCK_INIT_BASE} /lib/container.sh"
2842source " ${DOCK_INIT_BASE} /lib/iptables.sh"
29- source " ${DOCK_INIT_BASE} /lib/util/log.sh"
3043
3144# Initializes the dock
3245main () {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ vault::create_s3_policy() {
1616 " Dock-Init: Cannot create policy template for ${bucket} " \
1717 " Attempting to create s3 policy template. ${OUTPUT} "
1818
19- export VAULT_ADDR=" http://${CONSUL_HOSTNAME} :8200 "
19+ export VAULT_ADDR=" http://${VAULT_HOSTNAME} : ${VAULT_PORT} "
2020 log::info " Attempting to create s3 policy template for bucket ${bucket} "
2121
2222 local policy_template=" ${DOCK_INIT_BASE} /vault-resources/s3.policy"
@@ -35,7 +35,7 @@ vault::set_s3_keys() {
3535 " Dock-Init: Cannot create policy template" \
3636 " Attempting to create s3 policy template. ${OUTPUT} "
3737
38- export VAULT_ADDR=" http://${CONSUL_HOSTNAME} :8200 "
38+ export VAULT_ADDR=" http://${VAULT_HOSTNAME} : ${VAULT_PORT} "
3939 log::info " Attempting get s3 creds"
4040 # Key Value
4141 # lease_id aws/creds/deploy/7cb8df71-782f-3de1-79dd-251778e49f58
You can’t perform that action at this time.
0 commit comments