Ansible Conditionals

Inline expressions

Reference: Inline ‘if’ expressions

It’s possible to use inline if-expressions:

Note: See the Jinja2 Filters section for more information.

‘if/else’ example

Reference: cidr block’s git repo

Note: See the Jinja2 Filters section for more information.

‘When’ example

Reference: Ansible

Knowledge Base

See the Ansible section of my Knowledge Base for more information.

As always, if you have any questions or have a topic that you would like me to discuss, please feel free to post a comment at the bottom of this blog entry, e-mail at will@oznetnerd.com, or drop me a message on Twitter (@OzNetNerd).

Note: This website is my personal blog. The opinions expressed in this blog are my own and not those of my employer.