I've installed Ansible 1.2.3 on Ubuntu Precise 64.
Running ansible-playbook -i ansible_hosts playbook.yml
give me this error:
ERROR: problem running ansible_hosts --list ([Errno 8] Exec format error)
Here's the content of ansible_hosts
:
[development]
localhost ansible_connection=local
and playbook.yml
:
---
- hosts: development
sudo: yes
tasks:
- name: install curl
apt: pkg=curl update_cache=yes
How can I make this work?
I have a similar problem:
$ ansible --version
ansible 1.5.4
$ ansible-playbook -i hosts main.yml
ERROR: problem running /mnt/d/Works/ansible-zipkin/hosts --list ([Errno 8] Exec format error)
My steps for Debian/Ubuntu:
$ sudo apt-get purge ansible
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible
$ ansible --version
ansible 2.2.1.0
$ ansible-playbook -i hosts main.yml
Now it works!!!
For me, the problem was solved by removing "execute" permission on the ansible files (playbook, inventories etc):
find . -type f -exec chmod -x {} \;
you have to remove execution rights on ansible_hosts
chmod a-x ansible_hosts
if this doesn't work. try it with sudo
sudo chmod a-x ansible_hosts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With