Thank you so much

On Thursday, September 18, 2014 8:03:19 PM UTC+8, Matt Martz wrote:
>
> You can use the |default jinja2 filter to help you out:
>
> {{ ansible_env['NGINX_HOME']|default('') }}
>
>
> This will default the value to '' if NGINX_HOME does not exist in the dict.
>
> On Thu, Sep 18, 2014 at 4:53 AM, Zhenkai Jiang <[email protected] 
> <javascript:>> wrote:
>
>> I want to do some check using remote environment variables, which can be 
>> read from format like this
>>
>> {{ ansible_env.NGINX_HOME }}
>>
>> This "path" or environment variable can be absent, and that's the purpose 
>> of that check anyway.
>>
>> But Ansible treat this as a fatal error, showing error message like
>>
>> *One or more undefined variables: 'dict object' has no attribute 
>> 'NGINX_HOME'*
>>
>> What can I do to just skip this?
>>
>> -- 
>> 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/f58820d2-ed6f-4533-b3a7-2d57937949e1%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/f58820d2-ed6f-4533-b3a7-2d57937949e1%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Matt Martz
> [email protected] <javascript:>
> http://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 [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/e3406284-2590-4a49-9224-1bb27b09c6d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to