Install Ansible with ‘pip’ on macOS.


  • Ensure Apple’s command line tools are installed (xcode-select --install to launch the installer).
  • Install Ansible (or simply see below instructions)

The preferred way to install ansible on a Mac is via pip.

Ansible can be installed via “pip”, the Python package manager. If ‘pip’ isn’t already available in your version of Python, you can get pip by:

$ sudo easy_install pip

Then install Ansible with pip:

$ sudo pip install ansible

Or if you are looking for the latest development version:

pip install git+

If you are installing on OS X Mavericks, you may encounter some noise from your compiler. A workaround is to do the following:

$ sudo CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install ansible

Readers that use virtualenv can also install Ansible under virtualenv, though we’d recommend to not worry about it and just install Ansible globally. Do not use easy_install to install ansible directly.

  • Clone repository (git clone to your local drive.
  • Run $ ansible-galaxy install -r requirements.yml inside this directory to install required Ansible roles.
  • Run ansible-playbook main.yml -i inventory -K inside this directory. Enter your account password when prompted.

Leave a Reply