Environment:
OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):
CentOS 7.6
Version of Ansible (ansible --version):
ansible 2.7.10
Kubespray version (commit) (git rev-parse --short HEAD):
5e3bd2d (kubespray for 1.14.1 master)
Network plugin used:
calico(default CNI)
Copy of your inventory file:
all:
hosts:
master:
ansible_host: 10.10.1.11
ip: 10.10.1.11
access_ip: 10.10.1.11
worker1:
ansible_host: 10.10.1.13
ip: 10.10.1.13
access_ip: 10.10.1.13
worker2:
ansible_host: 10.10.1.14
ip: 10.10.1.14
access_ip: 10.10.1.14
children:
kube-master:
hosts:
master:
kube-node:
hosts:
worker1:
worker2:
etcd:
hosts:
master:
k8s-cluster:
children:
kube-master:
kube-node:
calico-rr:
hosts: {}
Command used to invoke ansible:
ansible-playbook -i inventory/mycluster/hosts.yml --become --become-user=root cluster.yml -vvv
Output of ansible run:
TASK [kubernetes/preinstall : Hosts | populate inventory into hosts file] *******************************************
task path: /root/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml:2
Monday 13 May 2019 16:53:08 +0900 (0:00:00.501) 0:00:35.762 ***
fatal: [worker1]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'address'\n\nThe error appears to have been in '/root/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Hosts | populate inventory into hosts file\n ^ here\n"
}
fatal: [worker2]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'address'\n\nThe error appears to have been in '/root/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Hosts | populate inventory into hosts file\n ^ here\n"
}
fatal: [master]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'address'\n\nThe error appears to have been in '/root/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Hosts | populate inventory into hosts file\n ^ here\n"
}
NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @/root/kubespray/cluster.retry
PLAY RECAP *****************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0
master : ok=56 changed=1 unreachable=0 failed=1
worker1 : ok=69 changed=1 unreachable=0 failed=1
worker2 : ok=56 changed=1 unreachable=0 failed=1
Anything else do we need to know:
i tried to install new kubernetes cluster with kube-spray lastest.
follow the instruction step by step
i install clean centos7.6 in my local machine
install docker version 18.06.3-ce
pip install -r requirements.txt
cp -rfp inventory/sample inventory/mycluster
declare -a IPS=(10.10.1.11 10.10.1.13 10.10.1.14)
CONFIG_FILE=inventory/mycluster/hosts.yml python3 contrib/inventory_builder/inventory.py ${IPS[@]}
and the i edit inventory/mycluster/hosts.yml for adjust master and node
but failed msg with
"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'address'\n\nThe error appears to have been in '/root/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Hosts | populate inventory into hosts file\n ^ here\n"
i guess ansible version issue or /root/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml file issue
the error occured in this code
i hope some check this issue and fix it for me
Your inventory file is in .ini format, but your host file is inventory/mycluster/hosts.yml which ends in .yml.
Try rename the host file to inventory/mycluster/hosts.ini
Your inventory file is in .ini format, but your host file is
inventory/mycluster/hosts.ymlwhich ends in.yml.Try rename the host file to
inventory/mycluster/hosts.ini
i tried it but i did't work...same result...
The same error :(
Your inventory file is in .ini format, but your host file is
inventory/mycluster/hosts.ymlwhich ends in.yml.Try rename the host file to
inventory/mycluster/hosts.ini
i already did but result same...not working...
The same error :(
my only solution is roll-back my branch to "add-vertwilst-reviewer" as kubernets v1.13.2...
i doubt ansibe version dependancy...but no evidence..
The same error :(
my only solution is roll-back my branch to "add-vertwilst-reviewer" as kubernets v1.13.2...
i doubt ansibe version dependancy...but no evidence..
Tks you!
I encounter this error when I didn't set the default route for each node, by adding a default route on each node I could by-pass this error.
route add default gw xxx.xxx.xxx.1
kube spray latest release solve the problem
The same issue
kubespray 8712bddcbe0ffa2e5a73ca8db73bada9e118c59d
ansible
ansible 2.7.12
config file = /tmp/kubespray/ansible.cfg
configured module search path = ['/tmp/kubespray/library']
ansible python module location = /tmp/p3/lib/python3.6/site-packages/ansible
executable location = /tmp/p3/bin/ansible
python version = 3.6.8 (default, Aug 7 2019, 17:28:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
TASK [kubernetes/preinstall : Hosts | populate inventory into hosts file] ************************************************************************
Saturday 28 September 2019 08:20:55 +0000 (0:00:00.630) 0:00:41.076 ****
fatal: [node1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'address'\n\nThe error appears to have been in '/tmp/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Hosts | populate inventory into hosts file\n ^ here\n"}
fatal: [node2]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'address'\n\nThe error appears to have been in '/tmp/kubespray/roles/kubernetes/preinstall/tasks/0090-etchosts.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Hosts | populate inventory into hosts file\n ^ here\n"}
Same here...
This happens when I deleted a route this way: sudo route del default.
I wanted to cut the internet connection of the VMs to test kubespray's offline installation mode.
@teramucho It seems, its not fixed, even on the last version (2.11). Unless the "fix" was to set back the route...
guys, we really need a fix for this, at least better error logs, 'dict object' has no attribute 'address' makes no sense for a valid hosts.yml or init file.