Skip to content

Commit 019b65b

Browse files
committed
terraform ecs debugging
1 parent 85bf51f commit 019b65b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ansible/roles/deploy-ecs-proxies/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
src: '{{ item.src }}'
6969
dest: "{{ out_dir }}/{{ item.path }}"
7070
mode: '{{ item.mode }}'
71+
vars:
72+
use_ecs_tag: "{{ lookup('env', 'TF_VAR_use_ecs_tag') | default('false') | bool }}"
7173
with_filetree: "{{ '../templates' }}"
7274
when: item.state == 'file'
7375

ansible/roles/deploy-ecs-proxies/templates/terraform/locals.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,25 @@ locals {
4646
ecs_service = [
4747
{% for container in ecs_service %}
4848

49+
# DEBUG: print the boolean value Jinja sees
50+
{% if use_ecs_tag %}
51+
{% set _ = print("DEBUG: use_ecs_tag = TRUE") %}
52+
{% else %}
53+
{% set _ = print("DEBUG: use_ecs_tag = FALSE") %}
54+
{% endif %}
55+
4956
{% set image_tag = (
5057
'${local.account_id}.dkr.ecr.eu-west-2.amazonaws.com/'
5158
+ service_id + '_' + container.name
5259
+ (
5360
":ecs-" + build_label
54-
if var.use_ecs_tag and container.name == "canary-api"
61+
if use_ecs_tag and container.name == "canary-api"
5562
else ":" + build_label
5663
)
5764
)
5865
%}
5966

67+
6068
{{
6169
(
6270
container

0 commit comments

Comments
 (0)