Thank you.
I found 2 errors in my code: 1 logical and 1 syntax.
Right conditions:
when: (ether_result is defined and ether_int_status is defined) and
(ether_int_status|failed or ether_result.changed)
понедельник, 18 августа 2014 г., 19:31:30 UTC+7 пользователь Michael DeHaan
написал:
>
> "More than 2 conditions not work...(("
>
> There's nothing in the code that has any bearing on how many conditions
> there are that makes 2 special, it's either "single" or "more than one"
>
> That being said, if you can explain what "doesn't work" looks like and
> provide a minimal playbook with output, we can try to reproduce what you
> are seeing.
>
> Thanks!
>
>
>
>
> On Mon, Aug 18, 2014 at 1:07 AM, Сергей Антипов <[email protected]
> <javascript:>> wrote:
>
>> when:
>> - ether_result is defined
>> - item|changed
>> - ether_int_status|failed
>>
>> This variant not work for me.
>> This works:
>> when:
>> - ether_result is defined
>> - ether_int_status|failed
>>
>> More than 2 conditions not work...((
>>
>> пятница, 15 августа 2014 г., 20:18:36 UTC+7 пользователь Michael DeHaan
>> написал:
>>>
>>> Yes, this would also be easy for you to test and try on your own too :)
>>>
>>> You can also do:
>>>
>>> - shell: foo
>>> when:
>>> - a == b
>>> - c == d
>>> - e == f
>>>
>>> And do ands that way, can sometimes be easier to read.
>>>
>>>
>>>
>>> On Fri, Aug 15, 2014 at 7:32 AM, Сергей Антипов <[email protected]>
>>> wrote:
>>>
>>>> Hello.
>>>>
>>>> This is possible to add more than 2 conditions like this?
>>>>
>>>> - shell: ifdown {{ item.item.device }}; ifup {{ item.item.device }}
>>>> with_items: ether_result.results
>>>> when: ether_result is defined and and item.changed and
>>>> ether_int_status|failed
>>>>
>>>> ether_result and ether_int_status are registered variables.
>>>>
>>>> --
>>>> 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/9d1e3e8e-b758-42ce-bcd3-
>>>> db617e0b52df%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/ansible-project/9d1e3e8e-b758-42ce-bcd3-db617e0b52df%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/a15db471-8348-4347-a7ed-4f0547e3d63a%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/a15db471-8348-4347-a7ed-4f0547e3d63a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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/8d0e0bde-f83a-4865-a6d2-8c2438d3e2a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.