You may want to use `variable_start_string`
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html#parameter-variable_start_string
and `variable_end_string`
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html#parameter-variable_end_string

On Fri, Jul 22, 2022 at 6:35 PM Mahesh Nalavade <
[email protected]> wrote:

> Hi Team,
>
> I have below template
> variables:
> =============
> sector: test
> project: test
>
>
> template:-
> ==============
>
> {% if ( env  == 'preprod') or ( env  == 'prod') %}
>   role_bindings:
>     - name: XXXXX
>       subjects:
>         - "{{k8s_sup_subjects['{{ sector }}-{{ project }}']}}"
> {% else %}
>   role_bindings:
>     - name: XXXX
>       subjects:
>         - "{{k8s_sup_subjects['{{ sector }}-{{ project }}']}}"
> {% endif %}
>
> problem:
> ===========
> i want to ignore the {{ from "{{k8s_sup_subjects['{{ sector }}-{{ project
> }}']}}"
>
> expected output
> ==================
> - "{{k8s_sup_subjects['test-test']}}"
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/cdd446e5-65bd-496e-9e21-f6e5ef1b2a48n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/cdd446e5-65bd-496e-9e21-f6e5ef1b2a48n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Thanks,
Abhijeet Kasurde

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFwWkHp5MUYnOri_BKomspbswaxW5X8KSRLApAr1BEW6yZDTuw%40mail.gmail.com.

Reply via email to