File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5555 tags : [ deploy ]
5656 become : true
5757 copy :
58- src=../../.. /secrets/docker-client/{{ file_name_item }}
58+ src=./secrets/docker-client/{{ file_name_item }}
5959 dest={{ build_dir }}/{{ name }}
6060 owner=ubuntu
6161 group=ubuntu
Original file line number Diff line number Diff line change 1111 - app_name : " krain"
1212 - enviroment_vars : enviroment_vars
1313
14+ # this requires the use of gnu/coreutils base64 (`brew install coreutils`)
15+ # Allows us to use same base64 locally and in host
1416- name : encode krain config to base64
1517 shell : cat ~/{{ app_name }}.conf | base64 -w 0
1618 register : krain_base64
2931 - app_name : " charon"
3032 - enviroment_vars : enviroment_vars
3133
32- - name : encode krain config to base64
34+ # this requires the use of gnu/coreutils base64 (`brew install coreutils`)
35+ # Allows us to use same base64 locally and in host
36+ - name : encode charon config to base64
3337 shell : cat ~/{{ app_name }}.conf | base64 -w 0
3438 register : charon_base64
3539 vars :
Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ export CONSUL_PORT={{ consul_api_port }}
55export CONSUL_HOSTNAME={{ consul_host_address }}
66export VAULT_PORT={{ vault_port }}
77
8+ {% set has_token = ( s3_access_key is defined and
9+ s3_secret_key is defined and
10+ aws_access_key is defined and
11+ aws_secret_key is defined ) %}
12+
13+ {% if not has_token %}
814# Create directory for env
915mkdir -p /opt/runnable/dock-init/consul-resources/vault/{{ node_env }}
1016chown ubuntu:ubuntu /opt/runnable/dock-init/consul-resources/vault/{{ node_env }}
@@ -14,6 +20,7 @@ chmod 0711 /opt/runnable/dock-init/consul-resources/vault/{{ node_env }}
1420{% for item in tokens %}
1521echo {{ item.value }} > /opt/runnable/dock-init/consul-resources/vault/{{ node_env }}/{{ item.file_name }}
1622{% endfor %}
23+ {% endif %}
1724
1825# Add upstart files for charon and krain
1926mkdir -p /docker/app-logs/
@@ -34,5 +41,9 @@ start amazon-ssm-agent
3441service krain start
3542service charon start
3643{% if not is_dock_pool %}
44+ {% if has_token %}
45+ CONSUL_HOSTNAME={{ consul_host_address }} CONSUL_PORT={{ consul_api_port }} VAULT_PORT={{ vault_port }} S3_ACCESS_KEY={{ s3_access_key }} S3_SECRET_KEY={{ s3_secret_key }} AWS_ACCESS_KEY={{ aws_access_key }} AWS_SECRET_KEY={{ aws_secret_key }} bash /opt/runnable/dock-init/init.sh | tee /var/log/user-script-dock-init.log
46+ {% else %}
3747CONSUL_HOSTNAME={{ consul_host_address }} CONSUL_PORT={{ consul_api_port }} VAULT_PORT={{ vault_port }} bash /opt/runnable/dock-init/init.sh | tee /var/log/user-script-dock-init.log
3848{% endif %}
49+ {% endif %}
You can’t perform that action at this time.
0 commit comments