Re: [ansible-project] `run_once` used together with `when` not generating expected result

2020-08-26 Thread csu...@gmail.com
Yes but what is the solution to combine those?
I need to execute a task on the second host in the play.

Op maandag 18 januari 2016 om 20:54:34 UTC+1 schreef mrles...@gmail.com:

> I banged my head against this same thing months ago until it finally 
> clicked on what was going on!
>
>
> On Monday, January 18, 2016 at 10:30:58 AM UTC-5, Brian Coca wrote:
>>
>> run_once limits the task to run on the 'first host' in the current 
>> play, so the when only evaluates for that host, if that host is not in 
>> 'group2' it will be skipped an no other host will be evaluated. 
>>
>>
>>
>> -- 
>> Brian Coca 
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6133c7a1-e861-42d3-8eb7-448938ed8398n%40googlegroups.com.


Re: [ansible-project] `run_once` used together with `when` not generating expected result

2016-01-18 Thread Brian Coca
run_once limits the task to run on the 'first host' in the current
play, so the when only evaluates for that host, if that host is not in
'group2' it will be skipped an no other host will be evaluated.



-- 
Brian Coca

-- 
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/CAJ5XC8%3D4eVEaH3%2BDyvYk%2BJOjmAnFtQoynBuRKx09OAbu0SB2XQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] `run_once` used together with `when` not generating expected result

2016-01-18 Thread Qiu Yu
On Monday, January 18, 2016 at 7:30:58 AM UTC-8, Brian Coca wrote:
>
> run_once limits the task to run on the 'first host' in the current 
> play, so the when only evaluates for that host, if that host is not in 
> 'group2' it will be skipped an no other host will be evaluated. 
>

Does that mean the `include` statement will be evaluated first no matter if 
`when` statement is satisfied or not?

QY

-- 
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/9f3908b8-20e5-4b0c-b664-804c45be94a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] `run_once` used together with `when` not generating expected result

2016-01-18 Thread Brian Coca
This is tricky, task includes are now dynamic in 2.0. Before 2.0 the
when: does not stop the include from happening, it just gets applied
to each included task, in 2.0 it does that only if the when cannot be
resolved with the information available at the time of the include.

-- 
Brian Coca

-- 
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/CAJ5XC8nb3YLwj8ke-8PtrjmtNUJz1ehZNUoBn2UUicBrbsffHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] `run_once` used together with `when` not generating expected result

2016-01-18 Thread Qiu Yu
On Monday, January 18, 2016 at 10:49:08 AM UTC-8, Brian Coca wrote:
>
> This is tricky, task includes are now dynamic in 2.0. Before 2.0 the 
> when: does not stop the include from happening, it just gets applied 
> to each included task, in 2.0 it does that only if the when cannot be 
> resolved with the information available at the time of the include. 
>

That explains a lot! Thanks Brian!!

QY 

-- 
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/ff482652-7179-45c2-a251-a7b2193177a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] `run_once` used together with `when` not generating expected result

2016-01-18 Thread Larry Smith
I banged my head against this same thing months ago until it finally 
clicked on what was going on!

On Monday, January 18, 2016 at 10:30:58 AM UTC-5, Brian Coca wrote:
>
> run_once limits the task to run on the 'first host' in the current 
> play, so the when only evaluates for that host, if that host is not in 
> 'group2' it will be skipped an no other host will be evaluated. 
>
>
>
> -- 
> Brian Coca 
>

-- 
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/55f7365f-c707-4bb2-a80f-f81482d6e681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.