[ansible-project] Ansible variables jinja and facts
So it’s confusing between all the rules on these three is there a good resource to go over this? Or maybe someone willing to help me this weekend figure out when you use quotes when you don’t and when you’re able to use variables. For example I attempted to do when: name.username == bob I’m having errors. Which I have an vars_files which contains a var array name: - username: bob. -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/24efa824-c984-4456-b295-c08150a2228c%40googlegroups.com.
[ansible-project] Issues with an jinja and magic variables script any help would be awesome
So I'm trying to combine magic variables and jinja. Unfortnately I'm running into issues. So This is the jinja script {% for host in groups['all'] %} {{ hostvars[host]['ansible_facts']['devices']['sda']['partitions']['sda1']['size'] }} {% endfor %} I run into this error "AnsibleUndefinedVariable: 'dict object' has no attribute 'devices'" } This works when I target a group with one managed host but not one with multiple managedhosts. I have tried with hostvars['host'] and no luck... -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3680213a-28fc-4858-a800-f0856fbecd3c%40googlegroups.com.