I setting up kubernetes cluster with 3 master and 5 node.I am deploying through ansible.
I am able to create these node.
I am using ansible 2.2.0.0. on host machine from where I am launching my script.
ansible_default_ipv4 is not getting populated and ansible script is failing while executing the following line.
{{ hostvars[item]['ansible_default_ipv4']['address'] }} {{ item }}
I have feeling that this could be because of environmental issue.
Please help me figure out this issue.
I am using
Linux installterinceptionvm2 4.2.0-30-generic #36~14.04.1-Ubuntu SMP Fri Feb 26 18:49:23 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53b77512-6787-40e9-b9a6-ef5a0c33e36c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
third-party-instance | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-node-4 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-node-1 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-node-2 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-node-3 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-master-1 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-node-5 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-master-2 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } kuberenetes-master-3 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } edge-instance-1 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } edge-instance-2 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } opendj | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true } inception | SUCCESS => { "ansible_facts": { "ansible_all_ipv4_addresses": [ "10.32.1.9" ], "ansible_default_ipv4": { "address": "10.32.1.9", "alias": "eth0", "broadcast": "10.32.1.255", "gateway": "10.32.1.1", "interface": "eth0", "macaddress": "fa:16:3e:cb:d6:e1", "mtu": 1500, "netmask": "255.255.255.0", "network": "10.32.1.0", "type": "ether" } }, "changed": false }
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5302bfca-cb4a-4caa-8c31-b3f4f47d403d%40googlegroups.com.
HI Ali,
---
- hosts: all
gather_facts: yes
tasks:
- name: vikram
# debug: msg="vikram"
#debug: msg={{ hostvars[item] }}
debug: msg={{ hostvars[item]['ansible_default_ipv4']['address'] }}
with_items:
- "{{ groups['all'] }}"
root@installterinceptionvm2:/home/ubuntu/ansible# ansible-playbook -i inventory/inventory test1.yml
PLAY [all] *********************************************************************
TASK [setup] *******************************************************************
fatal: [openam-instance]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-node-2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-node-3]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-node-4]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-node-5]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-master-2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-master-3]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [edge-instance-1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-master-1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [kuberenetes-node-1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
ok: [inception]
fatal: [edge-instance-2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
fatal: [opendj-instance]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
TASK [vikram] ******************************************************************
fatal: [inception]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'ansible_default_ipv4'\n\nThe error appears to have been in '/home/ubuntu/ansible/test1.yml': line 7, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: vikram\n ^ here\n"}
to retry, use: --limit @/home/ubuntu/ansible/test1.retry
PLAY RECAP *********************************************************************
edge-instance-1 : ok=0 changed=0 unreachable=1 failed=0
edge-instance-2 : ok=0 changed=0 unreachable=1 failed=0
inception : ok=1 changed=0 unreachable=0 failed=1
kuberenetes-master-1 : ok=0 changed=0 unreachable=1 failed=0
kuberenetes-master-2 : ok=0 changed=0 unreachable=1 failed=0
kuberenetes-master-3 : ok=0 changed=0 unreachable=1 failed=0
kuberenetes-node-1 : ok=0 changed=0 unreachable=1 failed=0
kuberenetes-node-2 : ok=0 changed=0 unreachable=1 failed=0
kuberenetes-node-3 : ok=0 changed=0 unreachable=1 failed=0
kuberenetes-node-4 : ok=0 changed=0 unreachable=1 failed=0
kuberenetes-node-5 : ok=0 changed=0 unreachable=1 failed=0
openam-instance : ok=0 changed=0 unreachable=1 failed=0
opendj-instance : ok=0 changed=0 unreachable=1 failed=0
Thanks kai for your suggestion.
but actual purpose of
hostvars[item]['ansible_default_ipv4']['address']
Is to add entry in hosts file in each machine.
Do you have any idea why this ansible_default_ipv4 is not available??
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/lpDuUpqdnys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f4ac8165-35b5-a062-2ea1-ab4383f85897%40olstad.com.
--
Kai Stian Olstad
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/33ddc90d-5275-6d24-6baa-cfe0e86bc6c5%40olstad.com.