This might work?

-Xms{{ (wildfly_memory_settings|default({'Xms': '64m'})).Xms }}

And if not, this ought:

-Xms{{ wildfly_memory_settings.Xms if wildfly_memory_settings is defined
else '64m' }}

On Mon, Jan 04, 2016 at 05:45:39AM -0800, jepper wrote:
> Hello all, please can someone help me explain why this jinja2 template fail 
> if I have not defined wildfly_memory_settings ?
> 
> JAVA_OPTS="-Xms{{ wildfly_memory_settings.Xms | default('64m') }}  -Xmx{{ 
> wildfly_memory_settings.Xmx | default('512m') }} -XX:MaxPermSize=256m 
> -verbose:gc -Djava.net.preferIPv4Stack=true"
> 
> The error: fatal: [targetbox] => {'msg': "AnsibleUndefinedVariable: One or 
> more undefined variables: 'wildfly_memory_settings' is undefined", 
> 'failed': True}
> 
> -- 
> 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/5ec331ce-6ac2-4c88-8281-39fe1499b570%40googlegroups.com.
> 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/20160104220017.GA23211%40neophile.
For more options, visit https://groups.google.com/d/optout.

Reply via email to