Skip to content

Commit 31be17c

Browse files
author
Henry Mollman
committed
PR comments
1 parent f9b3436 commit 31be17c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

ansible/roles/dock_launch_config/tasks/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
- app_name: "krain"
1212
- enviroment_vars: enviroment_vars
1313

14-
# this requires the use of gnu/coreutils base64
14+
# this requires the use of gnu/coreutils base64 (`brew install coreutils`)
15+
# Allows us to use same base64 locally and in host
1516
- name: encode krain config to base64
1617
shell: cat ~/{{ app_name }}.conf | base64 -w 0
1718
register: krain_base64
@@ -30,7 +31,8 @@
3031
- app_name: "charon"
3132
- enviroment_vars: enviroment_vars
3233

33-
# this requires the use of gnu/coreutils base64
34+
# this requires the use of gnu/coreutils base64 (`brew install coreutils`)
35+
# Allows us to use same base64 locally and in host
3436
- name: encode charon config to base64
3537
shell: cat ~/{{ app_name }}.conf | base64 -w 0
3638
register: charon_base64

ansible/roles/dock_launch_config/templates/init.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ chmod 0711 /opt/runnable/dock-init/consul-resources/vault/{{ node_env }}
1818
{% for item in tokens %}
1919
echo {{ item.value }} > /opt/runnable/dock-init/consul-resources/vault/{{ node_env }}/{{ item.file_name }}
2020
{% endfor %}
21+
{% set hasToken = false %}
22+
{% else %}
23+
{% set hasToken = true %}
2124
{% endif %}
2225

2326
# Add upstart files for charon and krain
@@ -39,5 +42,9 @@ start amazon-ssm-agent
3942
service krain start
4043
service charon start
4144
{% if not is_dock_pool %}
45+
{% if hasToken %}
46+
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
47+
{% else %}
4248
CONSUL_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
4349
{% endif %}
50+
{% endif %}

0 commit comments

Comments
 (0)