Ansible in MacosX


Ansible is a quite powerful tool for bootstrapping.

#prepare a dependencies
sudo easy_install jinja2
sudo easy_install PyYAML
sudo easy_install paramiko
#doing a checkout
git clone git://
cd ./ansible
#setting a env
source ./hacking/env-setup
cd ~
touch .ansible_hosts
#exporting a needed envs
export ANSIBLE_HOSTS=~/.ansible_hosts
echo echo “”
echo “” > ~/ansible_hosts
ansible all -m ping

Or if you needed a Ubuntu

Just use a package from


line 65, in <module>\r\n    import simplejson as json\r\nImportError: No module named simplejson

Just check a


How to define your host file ( in case you have multiple host files otherwise use the ANSIBLE_HOSTS environment variable).

ansible-playbook -i hosts infrastructure.yml

How to run only certain tags for all playbooks

ansible-playbook -i hosts infractructure.yml --tags backup

How to run a specific playbook

ansible-playbook -i hosts webservers.yml

How to run a specific group

ansible-playbook -i hosts infrastructure.yml --limit webservers

How limit the number of hosts for group ( first 10 )

ansible-playbook -i hosts infrastructure.yml --limit webservers[0-10]

Ansible Redhat trouble

ansible monitoring -i 8to_servers.ansible -m ping monitoring | FAILED >> { "failed": true, "msg": "Error: ansible requires a json module, none found!", "parsed": false }

Ansible requires python-simplejson being installed on EL boxes < 6. This is how modules can pass information back and forth (roughly).

You can bootstrap all your EL 5 boxes with this command:

ansible -i my-serverlist -u root -m raw -a "yum install -y python-simplejson"

Ansible playbooks personal cloud

bacula Ansible!msg/ansible-project/vgc2bFQgzmE/0SDKwCniPjgJ