Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-07-05 Thread Danny Cosson
Rich - what was the particular case that was fixed in the latest devel? Do you (or anyone else) have a link to the PR? I'm running into the exact issue you describe when trying to keep my ansible roles modular (i.e. passing boolean values in as arguments to the role instead of relying on the

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-06-05 Thread Rich Lees
Latest devel seems to work great for me now. Thanks to the developers for fixing it for this specific use-case. Our codebases no longer generate any warnings except one or two that are both valid and very easy to fix Thanks! On Tuesday, 30 May 2017 14:45:16 UTC+1, Ed wrote: > > [ Bringing a

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-30 Thread Ed
[ Bringing a question over here that was unanswered in ansible-project... ] I've got cases where I want to run the same complex task multiple times, with minor variances. I've been implementing that with a loop where each item has a property for its when statement, and the task uses

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-30 Thread Rich Lees
I mean Hi Brain! ooops... I have no idea how to edit posts either! On Tuesday, 30 May 2017 11:39:33 UTC+1, Rich Lees wrote: > > Hi Micheal, > > Thanks for the reply. I have also seen pretty much that any other example > of this warning being triggered is both valid and workaround-able. > > I

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-27 Thread Kai Stian Olstad
On 27. mai 2017 13:40, Jörg Kastning wrote: Am Freitag, 26. Mai 2017 18:12:43 UTC+2 schrieb Kai Stian Olstad: In your case you need to do what the warning says, remove the "{{ and the }}" and the warning will be gone. when: ("Complete!" in yum_output.stdout_lines[-1]) or

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-26 Thread Kai Stian Olstad
On 26. mai 2017 14:54, Jörg Kastning wrote: I found this discussion in the githup issue mentined above. In my case I need to run a play only when a certain string was found an the output of another command. Example main.yml from one of my roles: --- - name: Install Red Hat Security Advisory

[ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-26 Thread Jörg Kastning
Am Mittwoch, 24. Mai 2017 17:03:20 UTC+2 schrieb Rich Lees: > > Hi All, > > Am new to this group and Google Groups in general so please go easy. > > I have a few questions about the recent change in Ansible 2.3.0.0 that new > prints a warning when jinja2 templating is included in a when,

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-25 Thread Micheal Cottingham
That's fair. Thanks for the details. On Thu, May 25, 2017 at 11:31 AM Brian Coca wrote: > There are just 2 contexts, normal (you require them) and conditionals > (anything with when:) which don't. It is consistent, juts not uniform. > > -- > Brian Coca > -- You

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-25 Thread Brian Coca
There are just 2 contexts, normal (you require them) and conditionals (anything with when:) which don't. It is consistent, juts not uniform. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-25 Thread Micheal Cottingham
Hi, Thanks for getting back to me. I understand that in my case it is a valid warning for what it was designed for. Where I disagree is the warning being present in the first place. I admit that my use case is different, but as a new person to Ansible, it is confusing why there's a lack of

Re: [ansible-devel] Re: When statements with Jinja2 templating delimiters

2017-05-25 Thread Brian Coca
@Micheal, in your case having the extra moustaches ({{ }}) would cause unwanted double interpolation, @Rich is actually using that on purpose. So the warning was valid in your case, but not his. For templating there are mainly 2 rules (though 2nd is actually consequence of the first): -