# Ansible on OS X

**URL:** <https://forum.ansible.com/t/ansible-on-os-x/11907>\
**Category:** Ansible Project\
**Created:** [September 18, 2012, 10:37pm UTC](https://forum.ansible.com/t/ansible-on-os-x/11907 "2012-09-18T22:37:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PePe\_Amengual](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@PePe\_Amengual](https://forum.ansible.com/u/PePe_Amengual)\
**Post date:** [September 18, 2012, 10:37pm UTC](https://forum.ansible.com/t/ansible-on-os-x/11907/1 "2012-09-18T22:37:54Z")

</div>

Hi.

I’m trying to run ansible in osx, the idea is to run an ansible playbook to script the installation of Vagrant and a vagrant box that will run ansible-pull inside to deploy packages automatically using a playbook on git.

I installed the required python modules and I installed ansible doing make install but I’m getting this error :

ansible localhost -m ping  
Traceback (most recent call last):  
File “/usr/local/bin/ansible”, line 129, in   
(runner, results) = cli.run(options, args)  
File “/usr/local/bin/ansible”, line 70, in run  
inventory\_manager = inventory.Inventory(options.inventory)  
File “/Library/Python/2.6/site-packages/ansible/inventory/ **init**.py”, line 81, in **init**  
self.parser = InventoryScript(filename=host\_list)  
File “/Library/Python/2.6/site-packages/ansible/inventory/script.py”, line 32, in **init**  
sp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)  
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py”, line 595, in **init**  
errread, errwrite)  
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py”, line 1106, in \_execute\_child  
raise child\_exception  
OSError: [Errno 8] Exec format error

Is this something to do with 32 or 64 bit compatibility ?

Thanks.

---

<div class="post-metadata">

**Author:** ![PePe\_Amengual](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@PePe\_Amengual](https://forum.ansible.com/u/PePe_Amengual)\
**Post date:** [September 18, 2012, 10:50pm UTC](https://forum.ansible.com/t/ansible-on-os-x/11907/2 "2012-09-18T22:50:42Z")

</div>

So I follow the steps to run ansible from repo and it worked.

but why ?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 18, 2012, 11:55pm UTC](https://forum.ansible.com/t/ansible-on-os-x/11907/3 "2012-09-18T23:55:41Z")

</div>

It looks like your inventory file, hopefully in INI format, was marked  
executable but wasn't actually a script.

The solution would be to chmod -x the file.

---

<div class="post-metadata">

**Author:** ![PePe\_Amengual](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@PePe\_Amengual](https://forum.ansible.com/u/PePe_Amengual)\
**Post date:** [September 19, 2012, 5:09pm UTC](https://forum.ansible.com/t/ansible-on-os-x/11907/4 "2012-09-19T17:09:40Z")

</div>

it did work…

But why ansible will try to execute it ? should it just read the content of the file ?

Thanks again Michael.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 19, 2012, 5:52pm UTC](https://forum.ansible.com/t/ansible-on-os-x/11907/5 "2012-09-19T17:52:52Z")

</div>

Executable inventory files imply you are using an external inventory source, for instance you can supply host, group, and variable information from data sources like Cobbler or EC2 rather than maintaining the INI file.

– Michael

---

<div class="post-metadata">

**Author:** ![PePe\_Amengual](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@PePe\_Amengual](https://forum.ansible.com/u/PePe_Amengual)\
**Post date:** [September 19, 2012, 5:58pm UTC](https://forum.ansible.com/t/ansible-on-os-x/11907/6 "2012-09-19T17:58:32Z")

</div>

Ohhh I see now.

Thanks for the clarification.
