Tuesday, August 25, 2020

How to install Ansible on Mac OS | Ansible Installation Steps on Apple Mac OS

Ansible is one of the popular configuration management tools. Ansible can also be used for infrastructure provisioning as well in AWS. Please find steps for installing Ansible on Apple Mac OS or laptop.

Ansible can be installed on Mac OS many ways, but preferred way is using pip which is a Python package manager.

Install Pip

If pip isn’t already available on your system, run the following commands to install it:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
pip --version

Once pip is installed, install Ansible using pip.

Install Ansible using Pip
To install ansible globally, use following command
sudo -H pip3 install ansible
Once Ansible is installed, you can verify the version.

ansible --version
You should be able to see the version.

Install Boto framework
Boto is a Python package that provides interfaces to Amazon Web Service. It is AWS SDK for Python.

sudo pip install boto
sudo pip install boto3
 
Create Ansible hosts file
when you install Ansible on Mac OS, it does not create ansible hosts file. so you need to create it.
sudo mkdir /etc/ansible
 
Watch the above steps as a video in YouTube channel:

4 comments:

  1. Hi, every time I download the file for ansible it gives me an error:

    ERROR: Cannot uninstall 'pyparsing'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall

    ReplyDelete
    Replies
    1. Use the below command

      python3 -m pip install ansible

      This worked for me and installed ansible 2.10.3 on my Macbook pro 2019

      Delete
  2. I also got an error.
    ERROR: Could not find a version that satisfies the requirement ansible (from versions): none)
    ERROR:No matching distribution found for ansible

    ReplyDelete
  3. Where will be the ansible.cfg and how we can run Roles from mac

    ReplyDelete

DevSecOps Bootcamp Dec 2024 Schedule | DevSecOps & AWS Azure Cloud Coaching by Coach AK | DevSecOps and Cloud Computing Online Classes

Lot of new topics covered like GitHub Actions, GitHub Advanced Security, Helm, Prometheus and Grafana..) The DevOps requirements in the IT m...