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

**URL:** <https://forum.ansible.com/t/usr-bin-python-no-such-file-or-directory/27854>\
**Category:** Ansible Project\
**Tags:** kubernetes\
**Created:** [June 22, 2018, 5:31pm UTC](https://forum.ansible.com/t/usr-bin-python-no-such-file-or-directory/27854 "2018-06-22T17:31:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_Christian](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@Rob\_Christian](https://forum.ansible.com/u/Rob_Christian)\
**Post date:** [June 22, 2018, 5:31pm UTC](https://forum.ansible.com/t/usr-bin-python-no-such-file-or-directory/27854/1 "2018-06-22T17:31:17Z")

</div>

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](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:

`

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [June 22, 2018, 5:37pm UTC](https://forum.ansible.com/t/usr-bin-python-no-such-file-or-directory/27854/2 "2018-06-22T17:37:21Z")

</div>

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](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)

---

<div class="post-metadata">

**Author:** ![Rob\_Christian](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@Rob\_Christian](https://forum.ansible.com/u/Rob_Christian)\
**Post date:** [June 22, 2018, 7:50pm UTC](https://forum.ansible.com/t/usr-bin-python-no-such-file-or-directory/27854/3 "2018-06-22T19:50:12Z")

</div>

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/](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](https://coreos.com/blog/managing-coreos-with-ansible.html)

Thanks much for the help.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [June 22, 2018, 8:08pm UTC](https://forum.ansible.com/t/usr-bin-python-no-such-file-or-directory/27854/4 "2018-06-22T20:08:17Z")

</div>

The one you mention from 2014, references using this role: [https://github.com/defunctzombie/ansible-coreos-bootstrap](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.

---

<div class="post-metadata">

**Author:** ![Rob\_Christian](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@Rob\_Christian](https://forum.ansible.com/u/Rob_Christian)\
**Post date:** [June 22, 2018, 10:15pm UTC](https://forum.ansible.com/t/usr-bin-python-no-such-file-or-directory/27854/5 "2018-06-22T22:15:28Z")

</div>

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](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](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/](https://blog.octo.com/en/how-does-it-work-kubernetes-episode-4-how-to-ansible-your-coreos-and-etcd/)

Thanks again for the help.
