Please make sure there is a github ticket. -- Michael
On Dec 2, 2013, at 5:57 PM, Steven Truong <[email protected]> wrote: Hi, That was a typos on my part in earlier emails. I definitely think that I found something wrong here: create /etc/haproxy/bb.cfg] ****************************** fatal: [iad2-lb1] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} fatal: [iad2-lb1] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} fatal: [iad2-lb4] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} fatal: [iad2-lb4] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} fatal: [iad2-lb3] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} fatal: [iad2-lb3] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} fatal: [iad2-lb2] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} fatal: [iad2-lb2] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_default_ipv4'", 'failed': True} FATAL: all hosts have already failed -- aborting PLAY RECAP ******************************************************************** to retry, use: --limit @/home/steven/iad2-loadbalancer.retry iad2-lb1 : ok=4 changed=1 unreachable=1 failed=0 iad2-lb2 : ok=4 changed=1 unreachable=1 failed=0 iad2-lb3 : ok=4 changed=1 unreachable=1 failed=0 iad2-lb4 : ok=4 changed=1 unreachable=1 failed=0 ansible iad2-ads -m setup |grep ansible_default_ipv4 "ansible_default_ipv4": { "ansible_default_ipv4": { "ansible_default_ipv4": { "ansible_default_ipv4": { "ansible_default_ipv4": { "ansible_default_ipv4": { "ansible_default_ipv4": { "ansible_default_ipv4": { ----- create /etc/haproxy/bb.cfg] ****************************** fatal: [iad2-lb1] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} fatal: [iad2-lb1] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} fatal: [iad2-lb4] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} fatal: [iad2-lb2] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} fatal: [iad2-lb3] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} fatal: [iad2-lb4] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} fatal: [iad2-lb2] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} fatal: [iad2-lb3] => {'msg': "One or more undefined variables: 'dict' object has no attribute 'ansible_eth0'", 'failed': True} FATAL: all hosts have already failed -- aborting ansible iad2-lb-group1 -m setup |grep ansible_eth0 "ansible_eth0": { "ansible_eth0": { And here are the tests..... Second try with this: {% for host in groups['iad2-ads'] %} {{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}:80 {% endfor %} First try with this: {% for host in groups['iad2-ads'] %} {{ hostvars[host]['ansible_default_ipv4']['address'] }}:80 {% endfor %} ---- So for some strange reasons, ansible_default_ipv4 , ansible_eth0 are not available. Steven. On Monday, December 2, 2013 11:48:04 AM UTC-8, Steven Truong wrote: > > Hi all, > > Using the info from the document, I tried this but this totally does not > work. I tried a few different varibles such as ansible_ipv4 and nothing > seemed to work. > > {% for host in groups['iad2-ads'] %} > server {{ inventory_hostname }} {{ > hostvars[host]['ansible_all_ipv4_address'] }}:80 check > {% endfor %} > > Output: > > fatal: [iad2-lb2] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > fatal: [iad2-lb2] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > fatal: [iad2-lb3] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > fatal: [iad2-lb3] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > fatal: [iad2-lb4] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > fatal: [iad2-lb4] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > fatal: [iad2-lb1] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > fatal: [iad2-lb1] => {'msg': "One or more undefined variables: 'dict' > object has no attribute 'ansible_all_ipv4_address'", 'failed': True} > > FATAL: all hosts have already failed -- aborting > > Here is the output from module setup and it clearly show that this > variable is available... > > ansible iad2-ads -m setup |grep ansible_all_ipv4_address > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > "ansible_all_ipv4_addresses": [ > > > Please help. > > Thanks, > Steven. > -- 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]. For more options, visit https://groups.google.com/groups/opt_out. -- 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]. For more options, visit https://groups.google.com/groups/opt_out.
