Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"} on step Write kubelet config file (non-kubeadm) #3739

Closed
praparn opened this issue Nov 19, 2018 · 3 comments · Fixed by #3754

Comments

@praparn
Copy link

praparn commented Nov 19, 2018

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT

We facing problem for deploy kubespray with EC2 on AWS with 15 Host (3 Master, 12 Worker). On step "[kubernetes/node : Write kubelet config file (non-kubeadm)]" with error "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"

Environment:

  • Cloud provider or hardware configuration:
    AWS

  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):
    Linux 4.4.0-1052-aws x86_64
    NAME="Ubuntu"
    VERSION="16.04.4 LTS (Xenial Xerus)"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 16.04.4 LTS"
    VERSION_ID="16.04"
    HOME_URL="http://www.ubuntu.com/"
    SUPPORT_URL="http://help.ubuntu.com/"
    BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
    VERSION_CODENAME=xenial
    UBUNTU_CODENAME=xenial

  • Version of Ansible (ansible --version):
    ansible 2.7.2
    config file = /home/ubuntu/kubespray/ansible.cfg
    configured module search path = [u'/home/ubuntu/kubespray/library']
    ansible python module location = /usr/lib/python2.7/dist-packages/ansible
    executable location = /usr/bin/ansible
    python version = 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609]

Kubespray version (commit) (git rev-parse --short HEAD):
ac00d23

Network plugin used:
Calico

Copy of your inventory file:
[all]
ip-10-100-16-57.ap-southeast-1.compute.internal ansible_host=10.100.16.57 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.57
ip-10-100-16-135.ap-southeast-1.compute.internal ansible_host=10.100.16.135 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.135
ip-10-100-18-60.ap-southeast-1.compute.internal ansible_host=10.100.18.60 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.18.60
ip-10-100-16-110.ap-southeast-1.compute.internal ansible_host=10.100.16.110 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.110
ip-10-100-16-101.ap-southeast-1.compute.internal ansible_host=10.100.16.101 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.101
ip-10-100-16-15.ap-southeast-1.compute.internal ansible_host=10.100.16.15 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.15
ip-10-100-18-73.ap-southeast-1.compute.internal ansible_host=10.100.18.73 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.18.73
ip-10-100-18-164.ap-southeast-1.compute.internal ansible_host=10.100.18.164 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.18.164
ip-10-100-18-182.ap-southeast-1.compute.internal ansible_host=10.100.18.182 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.18.182
ip-10-100-16-230.ap-southeast-1.compute.internal ansible_host=10.100.16.230 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.230
ip-10-100-16-87.ap-southeast-1.compute.internal ansible_host=10.100.16.87 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.87
ip-10-100-16-22.ap-southeast-1.compute.internal ansible_host=10.100.16.22 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.16.22
ip-10-100-18-79.ap-southeast-1.compute.internal ansible_host=10.100.18.79 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.18.79
ip-10-100-18-86.ap-southeast-1.compute.internal ansible_host=10.100.18.86 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.18.86
ip-10-100-18-151.ap-southeast-1.compute.internal ansible_host=10.100.18.151 ansible_connection=ssh ansible_user=ubuntu ansible_become=yes ip=10.100.18.151

[kube-master]
ip-10-100-16-57.ap-southeast-1.compute.internal
ip-10-100-16-135.ap-southeast-1.compute.internal
ip-10-100-18-60.ap-southeast-1.compute.internal

[etcd]
ip-10-100-16-57.ap-southeast-1.compute.internal
ip-10-100-16-135.ap-southeast-1.compute.internal
ip-10-100-18-60.ap-southeast-1.compute.internal

[kube-node]
ip-10-100-16-110.ap-southeast-1.compute.internal
ip-10-100-16-101.ap-southeast-1.compute.internal
ip-10-100-16-15.ap-southeast-1.compute.internal
ip-10-100-18-73.ap-southeast-1.compute.internal
ip-10-100-18-164.ap-southeast-1.compute.internal
ip-10-100-18-182.ap-southeast-1.compute.internal
ip-10-100-16-230.ap-southeast-1.compute.internal
ip-10-100-16-87.ap-southeast-1.compute.internal
ip-10-100-16-22.ap-southeast-1.compute.internal
ip-10-100-18-79.ap-southeast-1.compute.internal
ip-10-100-18-86.ap-southeast-1.compute.internal
ip-10-100-18-151.ap-southeast-1.compute.internal

[k8s-cluster:children]
kube-master
kube-node

[calico-rr]

[vault]
ip-10-100-16-57.ap-southeast-1.compute.internal
ip-10-100-16-135.ap-southeast-1.compute.internal
ip-10-100-18-60.ap-southeast-1.compute.internal

Command used to invoke ansible:
ansible-playbook -i inventory/kubespray-aws-inventory.py -i inventory/k8sclusterprd/hosts.ini --become --become-user=root cluster.yml

Output of ansible run:


Monday 19 November 2018 17:51:24 +0000 (0:00:03.859) 0:18:36.994 *******
TASK [kubernetes/node : Write kubelet config file (non-kubeadm)]
fatal: [ip-10-100-18-60.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-57.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-135.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-18-73.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-18-86.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-87.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-230.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-110.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-18-164.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-22.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-18-182.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-18-79.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-101.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-18-151.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}
fatal: [ip-10-100-16-15.ap-southeast-1.compute.internal]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'unicode object' has no attribute 'items'"}

Anything else do we need to know:

@praparn
Copy link
Author

praparn commented Nov 20, 2018

Do i need to add any tag ?

@MiaoZhou
Copy link
Contributor

I am confusing about the conent produced by kubespray-aws-inventory.py and host.ini. They looks the same.

I copyed the script into my inventory directory ./inventory/aws-k8s/. Then the command:
ansible-playbook -b -i inventory/aws-k8s/kubespray-aws-inventory.py cluster.yml .

Same error i met with you.

@praparn
Copy link
Author

praparn commented Nov 23, 2018

For troubleshooting now. I'm cutting option "kubespray-aws-inventory.py" and let's deploy as on-prem host with set "cloud provider: aws". This way i found a lot of bug can fix and kubernetes work like usual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants