[webservers]
server1 city=amsterdam
server2 city=london
[databaseserver]
server3 city=amsterdam
server4 city=london
databaseserver"] | {{ hostvars["amsterdam"] }} | {{ ansible_eth0.ipv4.address }} }}
{{ hostvars[groups['databaseserver'][0]].ansible_eth0.ipv4.address }}
--To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0ec5b636-9383-4a80-9c51-28831b33406a%40googlegroups.com.
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
{{ hostvars[groups['databaseserver'][0]].ansible_eth0.ipv4.address }}
I get the following error running a playbook with the above in a template:
fatal: [localhost] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True}
fatal: [localhost] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True}
FATAL: all hosts have already failed -- aborting
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1cfae46f-eeea-4936-9cfe-1b9313c9a45f%40googlegroups.com.
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/383FAD2C9609F74D8F075EFF2B86B5795DA9ED95%40SGIS111.gisa-halle.de.
fatal: [ansible-test] => {'msg': "file: /etc/ansible/templates/CREDS.j2, line number: 2, error: expected token 'colon', got '}'", 'failed': True}
fatal: [ansible-test] => {'msg': "file: /etc/ansible/templates/CREDS.j2, line number: 2, error: expected token 'colon', got '}'", 'failed': True}
FATAL: all hosts have already failed -- aborting
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bc8dc0f8-9f85-44d7-86c1-b2ad4490c960%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/aa43b248-362c-44e2-bc3f-48143cbd259a%40googlegroups.com.
---
mysqlrootpass: XXXXXXXXXXXXXXXXXX
mysqluserpass: XXXXXXXXXXXXXXXXXX
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ff408d0b-36de-40c3-9fa5-c1c6771152d4%40googlegroups.com.