Day 8 of 100 Days of DevOps

Guide to installing Ansible on a jump host with pip, configuring PATH, and verifying its operation (agentless, SSH). Ideal for DevOps and secure automation.

domingo, 17 de agosto de 2025 • 3 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Why and how to install Ansible

Ansible is a powerful automation engine for configuration management, application deployment, and task automation. It is highly valued by system administrators and DevOps teams because it simplifies complex processes and ensures consistency across servers. A key advantage of Ansible is that it is agentless and connects via standard SSH, making it easy to set up and maintain.

Installation on a jump host

A jump host or bastion host is a secure server that acts as an intermediary to access other servers on a private network. Installing Ansible on a jump host allows you to centralize control and automation, improving security and access management.

The recommended way to install Ansible is using pip, the Python package installer, as it manages dependencies and is consistent with Ansible's Python-based nature.

Global installation with sudo pip

A simple way to install Ansible globally is with sudo pip install. This makes the binaries available to all users in the system's Python environment without needing to adjust each user's PATH.

However, using sudo pip install is generally discouraged because it can cause conflicts with the system package manager such as apt or yum and lead to version inconsistencies or stability issues. If you need to install a specific version of Ansible globally, you can specify the version in the command, for example sudo pip install ansible==VERSION, replacing VERSION with the desired version.

Fixing the PATH for all users

After a user-level installation, the Ansible binary may only be available to the person who performed the installation. To make Ansible accessible to all users, you must ensure that the installation directory is in the PATH environment variable, which is the list of paths where the system looks for executables.

Method 1: edit /etc/profile

This method affects all users when logging into a shell. One option is to open /etc/profile with a text editor with administrator privileges and add a line at the end that exports PATH with the corresponding path, for example export PATH=$PATH:/usr/local/bin. Then save and close the file and, if you want to apply it immediately, run source /etc/profile in the current session.

Method 2: update /etc/environment

The /etc/environment file applies to all processes and is usually more robust for defining a global PATH. Open /etc/environment with an editor such as vi using sudo vi /etc/environment, locate the PATH= line and add /usr/local/bin, separating it with a colon from the other paths, for example PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. Then save the changes and log out and back in for it to take effect.

Verification

To check that Ansible is globally available and working correctly, run which ansible and ansible --version as any system user.

About Q2BSTUDIO

Q2BSTUDIO is a software development company specialized in custom applications and custom software for companies that need solutions adapted to their processes. We offer artificial intelligence and AI services for businesses, AI agent development, and business intelligence solutions with Power BI to turn data into actionable decisions. We are also experts in cybersecurity and AWS and Azure cloud services, providing secure architectures, deployment, and cloud management. Additionally, we develop custom mobile and web applications, integrating artificial intelligence models and analytics services to improve operational efficiency.

If you need to automate infrastructures with Ansible, integrate AI agents, or deploy solutions on AWS or Azure, Q2BSTUDIO can design and implement a custom solution that combines automation, cybersecurity, and business intelligence services for your company. Relevant keywords to find our services: custom applications, custom software, artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, AI for businesses, AI agents, Power BI.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.