Prerequisites
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