Kubespray: fatal: [node1]: FAILED! => {"changed": false, "cmd": "apt-get update", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}

Created on 17 Feb 2017  路  4Comments  路  Source: kubernetes-sigs/kubespray

Environment:

  • Cloud provider or hardware configuration:
    Dedicated server
  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):
Linux 3.10.0-514.6.1.el7.x86_64 x86_64
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
  • Version of Ansible (ansible --version):
ansible 2.2.1.0
  config file = /home/jonathan/.kargo/ansible.cfg
  configured module search path = ['./library']

Kargo version (commit) (git rev-parse --short HEAD):
64e40d4

Network plugin used:
flannel

Copy of your inventory file:
[all]

## Configure 'ip' variable to bind kubernetes services on a
## different ip than the default iface
node1 ansible_ssh_host=192.10.25.00  #ip=172.31.17.156

[kube-master]
node1
# node2

[etcd]
node1
# node2
# node3

[kube-node]
node1
# node2
# node3
# node4
# node5
# node6

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

Command used to invoke ansible:

kargo deploy --ansible-opts '-b --become-user=root' -u jonathan -k ~/.ssh/id_rsa --inventory inventory/shawn.cfg -n flannel

Output of ansible run:

TASK [kubernetes/preinstall : Install latest version of python-apt for Debian distribs] ***
Friday 17 February 2017  21:22:42 +0000 (0:00:00.028)       0:00:10.331 ******* 
fatal: [node1]: FAILED! => {"changed": false, "cmd": "apt-get update", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}

Anything else do we need to know:

Most helpful comment

I know this issue is old but I faced this issue now and fixed it. I hope if anyone face this error can fix it too.

Actually, this happens mostly because of installing kargo multiple times with different OS in each time. this option

fact_caching_connection= /tmp at [repo]/ansible.cfg which create a file with the name of your hosts like:
/tmp/k8s-0[1-3]

Note: it can be different if you are not using default configruation - but it will usually be your host hostname

This file contains a cached information about your host for ansible which mostly was created at first for a different host that had the same hostname but different OS , you need to delete this file at /tmp
you can double check by grep "ansible_os_family" /tmp/k8s-01
You will find it mostly as in this case "ansible_os_family": "Debian", which is incorrect and need to by updated by deleting this file.

Fix is

rm /tmp/k8s-0*

All 4 comments

can you use -vvvv ? this task should be skip

You should try to figure out why Ansible thinks your host is running a debian-based linux OS

I know this issue is old but I faced this issue now and fixed it. I hope if anyone face this error can fix it too.

Actually, this happens mostly because of installing kargo multiple times with different OS in each time. this option

fact_caching_connection= /tmp at [repo]/ansible.cfg which create a file with the name of your hosts like:
/tmp/k8s-0[1-3]

Note: it can be different if you are not using default configruation - but it will usually be your host hostname

This file contains a cached information about your host for ansible which mostly was created at first for a different host that had the same hostname but different OS , you need to delete this file at /tmp
you can double check by grep "ansible_os_family" /tmp/k8s-01
You will find it mostly as in this case "ansible_os_family": "Debian", which is incorrect and need to by updated by deleting this file.

Fix is

rm /tmp/k8s-0*

Im still seeing this issue ,please guide me as am not able to install anything from awx in ubuntu.
same error im getting still.

please help me on this.

user@host:/tmp$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Was this page helpful?
0 / 5 - 0 ratings