/usr/bin/python: No such file or directory

Why am I getting this error? I have gather_facts: false in my file. My file is shown below. The original is here: https://github.com/sebiwi/kubernetes-coreos

`

TASK [Gathering Facts] **************************************************************************************************************************************

fatal: [kube-master-01]: FAILED! => {“changed”: false, “module_stderr”: “Connection to 127.0.0.1 closed.\r\n”, “module_stdout”: “/bin/sh: /usr/bin/python: No such file or directory\r\n”, “msg”: “MODULE FAILURE”, “rc”: 127}

fatal: [etcd-01]: FAILED! => {“changed”: false, “module_stderr”: “Connection to 127.0.0.1 closed.\r\n”, “module_stdout”: “/bin/sh: /usr/bin/python: No such file or directory\r\n”, “msg”: “MODULE FAILURE”, “rc”: 127}

fatal: [kube-worker-02]: FAILED! => {“changed”: false, “module_stderr”: “Connection to 127.0.0.1 closed.\r\n”, “module_stdout”: “/bin/sh: /usr/bin/python: No such file or directory\r\n”, “msg”: “MODULE FAILURE”, “rc”: 127}

fatal: [kube-worker-01]: FAILED! => {“changed”: false, “module_stderr”: “Connection to 127.0.0.1 closed.\r\n”, “module_stdout”: “/bin/sh: /usr/bin/python: No such file or directory\r\n”, “msg”: “MODULE FAILURE”, “rc”: 127}

PLAY RECAP **************************************************************************************************************************************

etcd-01 : ok=0 changed=0 unreachable=0 failed=1

kube-master-01 : ok=0 changed=0 unreachable=0 failed=1

kube-worker-01 : ok=0 changed=0 unreachable=0 failed=1

kube-worker-02 : ok=0 changed=0 unreachable=0 failed=1

`

My file:

`

Your first play does nothing, because it is not gathering facts, and you have the sole role commented out. So I’m guessing it immediately skips on to the 2nd play called “Create certificates for Kubernetes componentes” which does not skip fact gathering.

Ansible expects that it can find /usr/bin/python on the target machine. It appears as though you are missing a python interpreter at this location. See this doc for more info:

https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-handle-python-not-having-a-python-interpreter-at-usr-bin-python-on-a-remote-machine

I’m trying to run CoreOS, which doesn’t have python. I see that a few people have demonstrated running CoreOS with Ansible but these examples aren’t working for me. Could you direct me to an example which is current? And maybe simple enough I can build upon it to get a cluster working?

Tried this guide: https://blog.octo.com/en/how-does-it-work-kubernetes-episode-4-how-to-ansible-your-coreos-and-etcd/
Gives me these results:

`

PLAY RECAP *****************************************************************

etcd-01 : ok=28 changed=7 unreachable=0 failed=1

kube-master-01 : ok=25 changed=17 unreachable=0 failed=0

kube-worker-01 : ok=25 changed=8 unreachable=0 failed=0

kube-worker-02 : ok=25 changed=6 unreachable=0 failed=0

`

This one is from 2014, and the author makes reference to a bootstrap.yml which doesn’t seem to exist: https://coreos.com/blog/managing-coreos-with-ansible.html

Thanks much for the help.

The one you mention from 2014, references using this role: https://github.com/defunctzombie/ansible-coreos-bootstrap

Effectively, it is installing pypy on CoreOS.

I haven’t touched CoreOS in several years, I cannot speak to what may be up to date at this point.

Update: It’s now almost completely working for me. Here’s my fork, I’ve committed my latest changes: https://github.com/rm-rf-etc/kubernetes-coreos

There were two issues causing the errors: 1) He used Ansible 2.2, I’m using 2.5.4, this why Ansible complained about deprecated tests as filters, 2) Etcd is now on version 3 and it was moved + renamed in CoreOS stable.

BTW, Matt, which OS do you use? And are you running kubernetes? I selected CoreOS because DigitalOcean supports it and I saw some kubernetes guides using it.

For the etcd setup (roles/configure/tasks/test.yml), I made a couple small changes, here’s the code I have right now:

`

  • name: Wait for port 2379 to listen
    wait_for:
    port: 2379
    delay: 20

  • name: Get etcd nodes
    command: etcdctl ls /
    register: etcd_nodes
    changed_when: false
    until: “‘/coreos.com’ in etcd_nodes.stdout”
    retries: 10
    delay: 10

`

Here is the original: https://github.com/rm-rf-etc/kubernetes-coreos/blob/master/roles/configure/etcd/tasks/test.yml

The last task is failing. This is the output:

`

TASK [configure/etcd : Get etcd nodes] **************************************************************************************************************************

FAILED - RETRYING: Get etcd nodes (10 retries left).

FAILED - RETRYING: Get etcd nodes (9 retries left).

FAILED - RETRYING: Get etcd nodes (8 retries left).

FAILED - RETRYING: Get etcd nodes (7 retries left).

FAILED - RETRYING: Get etcd nodes (6 retries left).

FAILED - RETRYING: Get etcd nodes (5 retries left).

FAILED - RETRYING: Get etcd nodes (4 retries left).

FAILED - RETRYING: Get etcd nodes (3 retries left).

FAILED - RETRYING: Get etcd nodes (2 retries left).

FAILED - RETRYING: Get etcd nodes (1 retries left).

fatal: [etcd-01]: FAILED! => {“attempts”: 10, “changed”: false, “cmd”: [“etcdctl”, “ls”, “/”], “delta”: “0:00:00.012560”, “end”: “2018-06-22 22:01:54.446159”, “rc”: 0, “start”: “2018-06-22 22:01:54.433599”, “stderr”: “”, “stderr_lines”: , “stdout”: “”, “stdout_lines”: }

PLAY RECAP ******************************************************************************************************************************************************

etcd-01 : ok=26 changed=0 unreachable=0 failed=1

kube-master-01 : ok=21 changed=0 unreachable=0 failed=0

kube-worker-01 : ok=21 changed=0 unreachable=0 failed=0

kube-worker-02 : ok=21 changed=0 unreachable=0 failed=0

make: *** [playbook] Error 2
`

I don’t see how the nodes are supposed to find each other because I don’t see anywhere in the process where the discovery token is provided. Can nodes find each other without using the discovery service? See the “etcd” section here: https://blog.octo.com/en/how-does-it-work-kubernetes-episode-4-how-to-ansible-your-coreos-and-etcd/

Thanks again for the help.