Thank you for the quick response. I think I got the error to go away but I 
m facing a different issue now; I am using debug/msg to print the value of 
the variable and for some reason a newline character is being appended, for 
example, instead of just 'subnet1', I get  'subnet1\n'. Adding 
'#jinja2:trim_blocks: True, lstrip_blocks: True' doesn't help.

On Saturday, July 30, 2016 at 12:21:46 PM UTC-4, Kai Stian Olstad wrote:
>
> On 30. juli 2016 17:41, a akin wrote: 
> > I am sorry, those were typos: 
> > template: 
> > {% if subnet == 'subnet-ab1' %} 
> > subnet1 
> > {% elif subnet == 'subnetab2' %} 
> > subnet2 
> > {% elif subnet == 'subnetab3' %} 
> > subnet3 
> > {% elif subnet == 'subnetab4' %} 
> > subnet4 
> > {% else %} 
> > subnet5 
> > {% endif %} 
> > 
> > playbook: 
> > group_id: "{{ lookup('template', 'sec_grp.j2') }}" 
>
> Testet the code in v2.1.1 and it's working for me. 
>
> -- 
> Kai Stian Olstad 
>
>

-- 
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/701d4517-7c1f-44e7-9b4d-2789715a86b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to