I've discovered behavior that seems to indicate that Ansible's handling of
variables and facts is even more brittle than I had originally guessed. I
hope that's not the case; I hope I'm just being dense.
Could someone verify whether the following behavior is intended? If so,
I'll just go back to using Bash scripts.
*$ ansible-playbook -i=localhost, play1.yml*
ERROR! 'test_fact' is undefined
*$ cat play1.yml*
# play1.yml
---
- hosts: localhost
tasks:
- set_fact: test_fact='hello'
- include: "{{ test_fact }}"
*$ ansible-playbook -i=localhost, play2.yml*
ERROR! 'test_fact' is undefined
*$ cat play2.yml*
# play2.yml
---
- hosts: localhost
vars:
test_fact: 'hello'
- include: "{{ test_fact }}"
--
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/488c24c4-eaa1-4f83-8c91-ee3675003435%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.