Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Udemy Section-4 Video#16 : Example script 05 @ minute 3:55 #11

Open
ababatjosef opened this issue Jan 6, 2022 · 0 comments
Open

Udemy Section-4 Video#16 : Example script 05 @ minute 3:55 #11

ababatjosef opened this issue Jan 6, 2022 · 0 comments

Comments

@ababatjosef
Copy link

ababatjosef commented Jan 6, 2022

Hi James. There is nothing really wrong in the content of the video referenced here. I am just pointing out to you to reconsider to avoid using Jinja keywords for use in either Variable or Value. Please take a loot at Section-4 Video#16 : Example script 05 @ minute 3:55.

Please review my previous post as shown below.

ansible@ubuntu-c[05]-> $ cat Jinja2_playbook.yaml

---
-
hosts: all
tasks:
- name: Ansible Jinja2 if variable is defined ( where variable is defined )
debug:
msg: >
--== Ansible Jinja2 if variable is defined ( where variable is defined ) ==--
{% set example_variable = 'monkey' -%} # I replaced 'defined' to 'monkey'
{% if example_variable is defined -%} # !!! 'defined' is a keyword
example_variable is defined
{% else -%}
example_variable is not defined
{% endif %}
...
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant