Re: [ansible-project] when: var is defined deprecated?

2016-09-20 Thread pixel fairy
yes. used a group so the when was not needed.

On Tuesday, September 20, 2016 at 7:11:17 AM UTC-7, Matt Martz wrote:
>
> You should generally provide your full task, so I'm going to take a guess 
> here.
>
> I am pretty sure the problem is that you are using `with_items: users` 
> also.  The problem is that `when` statements are evaluated *after* 
> `with_items`, since the `when` statement is evaluated per item in the loop. 
>
> On Tue, Sep 20, 2016 at 5:42 AM, pixel fairy  > wrote:
>
>> using ansible 2.1.1.0
>>
>> running a task with 'when: users is defined' works fine for hosts that 
>> have that variable. for hosts that dont, the play still runs, but gives a 
>> warning that in the future, an undefined variable will be a fatal error. is 
>> there another way of running tasks based on the existence of a given var?
>>
>> -- 
>> 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 ansible-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/c5e217aa-c58b-41c6-ad76-4911e6fdd8f6%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Matt Martz
> @sivel
> sivel.net
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0dca6554-d609-4642-b764-9b56bbc6344a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] when: var is defined deprecated?

2016-09-20 Thread Matt Martz
You should generally provide your full task, so I'm going to take a guess
here.

I am pretty sure the problem is that you are using `with_items: users`
also.  The problem is that `when` statements are evaluated *after*
`with_items`, since the `when` statement is evaluated per item in the loop.

On Tue, Sep 20, 2016 at 5:42 AM, pixel fairy  wrote:

> using ansible 2.1.1.0
>
> running a task with 'when: users is defined' works fine for hosts that
> have that variable. for hosts that dont, the play still runs, but gives a
> warning that in the future, an undefined variable will be a fatal error. is
> there another way of running tasks based on the existence of a given var?
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/c5e217aa-c58b-41c6-ad76-4911e6fdd8f6%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v9wKfg9D-wbdeWDc4KnQXi58bTZ3zLb%2B2O_nzg%3Dhm2dsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] when: var is defined deprecated?

2016-09-20 Thread pixel fairy
using ansible 2.1.1.0

running a task with 'when: users is defined' works fine for hosts that have 
that variable. for hosts that dont, the play still runs, but gives a 
warning that in the future, an undefined variable will be a fatal error. is 
there another way of running tasks based on the existence of a given var?

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c5e217aa-c58b-41c6-ad76-4911e6fdd8f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.