Get up to 50% off on CKA, CKAD, CKS, KCNA, KCSA exams and courses!

Installing Ansible

Installing Ansible

You may refer installation doc from official document as well.

Requirement

Controlnodes

Controlnode is just the machine where we install the Ansible program and will contain copies of your project file including ansible playbooks. It can be a workstation, a virtual machine or a dedicated server in the environment.

  • No specific HW requirements for control node server

Linux/Unix systems only (Windows not currently supported) Software

  • Ansible (ansible.com/get-started)
  • Python 2.6 or later
  • Python2-winrm (0.2.2 or later) provides pywinrm python package

Managed Hosts

These are listed servers or nodes in the inventory – defined as static or via dynamic inventory scripts – on which Ansible commands or playbook tasks need to be executed.

Linux

  • Linux managed hosts need to have Python 2 (2.4 or later) installed for most modules to work.
  • python-simplejson (if old RHEL5)
  • libselinux=python (if SELinux is enabled)

Windows

  • Most of the modules specifically designed for Microsoft Windows hosts require PowerShell 3.0 or higher on the managed host rather than Python.
  • PowerShell remoting enabled.

Installing Ansible

Check installed python version

yum list installed python

Install Ansible

yum install -y ansible

Test installed version

[devops@ansible-box dep-install]$ ansible --version
ansible 2.3.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]

Other Methods 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

$ sudo pip install ansible

PPA Repo

$ sudo apt-get install ansible

If CentOS, configure EPEL repo (Extra Packages for Enterprise Linux)

sudo yum -y install epel-release

Want to know more about Ansible ? Read next part on Deploying Ansible

See all parts of Automation with Ansible Guides here

Gineesh Madapparambath

Gineesh Madapparambath

Gineesh Madapparambath is the founder of techbeatly. He is the co-author of The Kubernetes Bible, Second Edition and the author of Ansible for Real Life Automation. He has worked as a Systems Engineer, Automation Specialist, and content author. His primary focus is on Ansible Automation, Containerisation (OpenShift & Kubernetes), and Infrastructure as Code (Terraform). (Read more: iamgini.com)


Note

Disclaimer: The views expressed and the content shared in all published articles on this website are solely those of the respective authors, and they do not necessarily reflect the views of the author’s employer or the techbeatly platform. We strive to ensure the accuracy and validity of the content published on our website. However, we cannot guarantee the absolute correctness or completeness of the information provided. It is the responsibility of the readers and users of this website to verify the accuracy and appropriateness of any information or opinions expressed within the articles. If you come across any content that you believe to be incorrect or invalid, please contact us immediately so that we can address the issue promptly.

Share :

Related Posts

4 Websites You Can Use For Subnet Calculation

4 Websites You Can Use For Subnet Calculation

You might be a System Administrator, Developer, Infra Designer, Architect or a Capacity Manager by role, but getting quick information on your VLAN or …

How to Install and Configure AWS Command Line Interface (CLI)

How to Install and Configure AWS Command Line Interface (CLI)

The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control …

Ansible Automation for Absolute Beginners – Free Course

Ansible Automation for Absolute Beginners – Free Course

Are you new to the world of automation and eager to unlock the power of Ansible? You’re in the right place! In our quest to make Ansible accessible to …