Ansible - Install ansible-lint on Linux using pip

Prerequisites

  • Linux OS - The system that Ansible is installed on is known as the control node. Windows is not supported for the control node. Instead, Ansible must be installed on a Linux distribution.
  • Python - The control node must have Python version 2.7 or higher or Python version 3.5 or higher installed. The python --version command can be used to determine if Python is installed and the version that is installed. If Python is not installed, the installation of Ansible will also install Python.

Install

The pip3 --version can be used to determine if pip3 is installed. If pip3 is installed, something like this should be displayed. If pip3 is not installed, refer to Installing PIP on Linux CentOS.

pip3 --version

pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

 

The hash command caches the paths to commands, and if a command is relocated then bash will not pick it up unless that cache is cleared. Issue the following command to clear Ansible from the cache.

hash -d ansible-lint

 

Use pip3 to install ansible.

pip3 install ansible-lint

 

The pip3 list command can be used to ensure that Ansible was installed. In this example, Ansible version 2.9.12 is installed.

pip3 show ansible-lint

Name: ansible-lint
Version: 4.3.1
Summary: Checks playbooks for practices and behaviour that could potentially be improved
Home-page: https://github.com/ansible/ansible-lint
Author: Will Thames
Author-email: will@thames.id.au
License: MIT
Location: /usr/lib/python3.6/site-packages
Requires: pyyaml, typing-extensions, ruamel.yaml, ansible, rich

 

Likewise, the ansible-lint --version command will display the version of ansible-lint that was installed.

~]# ansible-lint --version

ansible-lint 4.3.1

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter e85e2 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |