Ansible on OS X

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.

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

but why ?

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.

it did work…

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

Thanks again Michael.

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

Ohhh I see now.

Thanks for the clarification.