On Thursday, 26 January 2017 07:50:39 UTC, Michael Shi wrote:
>
> Is there really no better way to do it? While Leo's method works it's
> extremely ugly to look at nor easily reusable.
>
Would this help you?
- name: do something
shell: do task
when: ansible_local[foo] is defined
Instead
On 26.01.17 08:50 Michael Shi wrote:
> On Friday, 31 January 2014 22:58:17 UTC+11, Stephen Ryan wrote:
>> This works perfectly for most situations however we have a number
>> of places where we need to unset the variable to stop the command
>> on certain hosts. Neither of the following work when
Is there really no better way to do it? While Leo's method works it's
extremely ugly to look at nor easily reusable.
On Friday, 31 January 2014 22:58:17 UTC+11, Stephen Ryan wrote:
>
>
>
> Best to explain with an example
>
> We have tasks setup like
>
> - name: do something
> shell: do task
>
Tell me about it Leo, the documentation on this language is seriously
lacking.
On Tuesday, April 7, 2015 at 12:54:01 AM UTC-7, Jialiang Liang wrote:
>
> I faced the same problem.
>
> I tried Nick Groenen's code and it doesn't work when the params is like
> this:
> ```
> foo:
> ```
> in this
@ Leo Thanks, this work for me as well
On Tuesday, April 7, 2015 at 12:54:01 PM UTC+5, Jialiang Liang wrote:
>
> I faced the same problem.
>
> I tried Nick Groenen's code and it doesn't work when the params is like
> this:
> ```
> foo:
> ```
> in this case, foo is define and foo == none
>
>
I faced the same problem.
I tried Nick Groenen's code and it doesn't work when the params is like
this:
```
foo:
```
in this case, foo is define and foo == none
And it doesn't work when foo: ' '
This is what I came up with:
not((foo is undefined) or (foo is none) or (foo|trim == ''))
Not