Questions
- Jinja2 conditionals can be used to render content inline with a playbook task.
a) True
b) False
- With of the following Jinja2 constructs will print an empty line each time it is evaluated?
a)
{% if loop.first -%}
b)
{% if loop.first %}
c)
{%- if loop.first -%}
d)
{%- if loop.first %}
- Jinja2 macros can be used to do which of the following?
a) Define a sequence of keystrokes that need to be automated.
b) Define a function for automating spreadsheets with Ansible.
c) Define a function that gets called regularly from elsewhere in the template.
d) Macros are not used in Jinja2.
- Which of the following is a valid expression for chaining two Jinja2 filters together to operate on an Ansible variable?
a)
{{ value.replace('A', 'B').lower }}
b)
{{ value | replace('A', 'B') | lower }}
c)
value.replace('A', 'B').lower
d)
lower(replace('A', 'B',value))
- Jinja2 filters always have mandatory arguments.
a)...