Hi,
I'm trying to use jinja for setting test_plan parameter in group_vars based
on some variables passed by --extra-vars.
This is my group_vars/load_drivers content:
--
{% if ENVIRONMENT_SPLIT == single %}
test_plan: '{{ load_driver_dir }}/{{ ENVIRONMENT_SPLIT }}_{{ TEST_STACK_1
}}_soak_test_plan.jmx'
{% elif "'{{ ENVIRONMENT_SPLIT }}' == 'multi'" and "'{{ TEST_STACK_2 }}' !=
'None'" and "'{{ TEST_STACK_1 }}' != '{{ TEST_STACK_2 }}'" %}
test_plan: '{{ load_driver_dir }}/{{ ENVIRONMENT_SPLIT }}_{{ TEST_STACK_1
}}_{{ TEST_STACK_2 }}_soak_test_plan.jmx'
{% elif "'{{ ENVIRONMENT_SPLIT }}' == 'multi'" and "'{{ TEST_STACK_2 }}' ==
'None'" %}
test_plan: '{{ load_driver_dir }}/{{ ENVIRONMENT_SPLIT }}_{{ TEST_STACK_1
}}_{{ TEST_STACK_1 }}_soak_test_plan.jmx'
{% endif %}
I execute main playbook:
ansible-playbook main.yml --extra-vars="ENVIRONMENT_SPLIT='single'
TEST_STACK_1='comm1' TEST_STACK_2='comm1'"
but unfortunately I get error message:
{% if ENVIRONMENT_SPLIT == single %}
test_plan: '{{ load_driver_dir }}/{{ ENVIRONMENT_SPLIT }}_{{ TEST_STACK_1
}}_soak_test_plan.jmx'
^
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
[SSH] exit-status: 1
Finished: FAILURE
I tried to use different quotas in different places but same results every
time.
Can you help me with this issue?
W.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/bc12076f-af27-4cd9-bdea-0db82cad8e00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.