Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-19 Thread Nuno Jordão
Well, after reading the other discussion, I think you are right. The safest is to use the default. The conditional can be unpredictable which was what I was afraid and why I started this thread. Ansible should avoid these situations. Or maybe provide a warning of potential unsafe situations. About

Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-18 Thread Vladimir Botka
On Tue, 18 Feb 2020 14:45:34 + Nuno Jordão wrote: > Some times I dont like to use the loop: "{{ nulo|default([]) }}" because it > doesn't say "skipping" and in complex playbook with lots of hosts I like to > have that feedback. You might want to find a plugin which fits your needs https://do

Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-18 Thread Stefan Hornburg (Racke)
On 2/18/20 3:45 PM, Nuno Jordão wrote: > Hello, > > Thank you for your responses. > Some times I dont like to use the loop: "{{ nulo|default([]) }}" because it > doesn't say "skipping" and in complex > playbook with lots of hosts I like to have that feedback.  > > I tested several options and an

Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-18 Thread Nuno Jordão
Hello, Thank you for your responses. Some times I dont like to use the loop: "{{ nulo|default([]) }}" because it doesn't say "skipping" and in complex playbook with lots of hosts I like to have that feedback. I tested several options and and everything works, even the case of the issue 45976

Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-17 Thread Vladimir Botka
On Mon, 17 Feb 2020 20:11:07 + Nuno Jordão wrote: > - name: "test loop" > debug: > msg: "test" > loop: "{{nulo}}" > when: nulo is defined > > where "nulo" is an undefined variable. Here the task skips instead of > failing. Instead of testing whether the variabl

Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-17 Thread Mauricio Tavares
On Mon, Feb 17, 2020 at 3:11 PM Nuno Jordão wrote: > > Hello, > > I have a doubt regarding loops and conditionals that maybe someone can make > it clear to me. > In the documentation is stated that: > > "When combining Conditionals with a loop, the when: statement is processed > separately for e

[ansible-project] Doubt regarding loops and conditionals

2020-02-17 Thread Nuno Jordão
Hello, I have a doubt regarding loops and conditionals that maybe someone can make it clear to me. In the documentation is stated that: "When combining Conditionals with a loop, the when: state