Introduction
Ansible is an open-source IT automation tool that helps you create, manage, deploy, and use many other IT processes. Ansible helps you with the easy installation of software. The IT professionals mostly use it for automation in the deployment, cloud, maintenance of the systems, updates, and almost everything.

Pip: Pip is called a python package manager. It manages and looks at the necessary dependency. It is independent of Operating System. It is used to install the dependencies not available in the standard python package. It has different commands like ”pip install” to install any package, “list,” which is used to see the list of packages supported by it with the version, and many more.
Installation of the Pip
Using pip, there are two methods to install a module.
- Using direct installation
- Using the requirement File
Using Direct Installation
To install a new python library, setting the package name against the ”name” parameter is mandatory. The default setting of the state parameter is present. So the module will try to install the library.
If the library is present, no changes will be made, and the version will not be upgraded.
–hosts all
tasks:
–name: Install Numpy python library using pip
pip:
name: NumPy
For installing a particular version of the library you can also mention the version of the library inside the “version” parameter.

–hosts all
tasks:
–name: Installation of the library with a version using pip
pip:
name: NumPy
version: “1.23.2”
To delete or uninstall a library, you can change the state parameter by default set to ”absent”.

This will uninstall the library present in your system
–hosts all
tasks:
–name: Uninstallation of the library with a version using pip
pip:
name: NumPy
version: “1.23.2”
state: absent
To reinstall an already present library, we can change the state parameter by default set to ”forcereinstall.” You can even mention the version of the library you want to reinstall on your device.

–hosts all
tasks:
–name: Force Installation of a library using pip
pip:
name: NumPy
version: “1.23.2”
state: forcereinstall
To install multiple libraries at a single time, mention all the libraries in the name parameter with a comma.

–hosts all
tasks:
–name: Installation of multiple libraries using pip
pip:
name: TensorFlow, NumPy, Pandas
Using the Requirement File
If you have all the dependencies in your remote server, give that file location to the requirements parameter in the pip.
–hosts all
tasks:
–name: Installing libraries using file
pip:
requirements: necessary.text







