How to Install Ansible on a Linux Server

Installing Ansible is the first step to automating tasks to save time. Below we cover how to get started with Ansible depending on your operating system (OS):

Ansible Installation Methods

Before you begin, open your terminal (or SSH for server installation), ensure you have Python version 2.7 or 3.5+ , and note your Linux server version: cat /etc/release .

Ansible PIP Installation

We recommend you consider using Python Installs Packages (PIP) to install Ansible, especially if you’re already using it. Python Package Index is updated more regularly than many Linux package management systems. This also guarantees compatibility with InMotion Hosting Ansible Galaxy roles which require PIP packages.

  1. Check if it’s installed: pip -V
  2. Install PIP if needed
  3. Install Ansible with PIP: pip install --user ansible

Package Manager

If you prefer to use your native package manager, follow official Ansible documentation for your operating system (OS) – CentOS, Ubuntu, Debian, Arch Linux, etc.

Server Installation with our Ansible Management Container

InMotion Hosting customers on a Cloud Server or Dedicated Bare-Metal Server can get started with our Ansible Management Container in AMP. Running your Ansible tasks on a dedicated Ansible agent ensures stable network connectivity, while freeing up your local resources. It also includes the GNU Screen and Tmux terminal multiplexers to ensure your playbooks complete even if the network connection ends prematurely and more.

This is great for users who may want technical assistance from our Managed Hosting team. We’re familiar with the configuration. The Ansible Agent is highly available and includes all dependencies required to deploy software from our Ansible Catalog.

Create a snapshot in Account Management Panel (AMP) before continuing in case anything goes wrong.

  1. Log into AMP
  2. Click the Ansible button under Manage My Account
  3. Add your SSH Key
  4. On the Ansible page, select Start Ansible Container
  5. Save your port number and IP address to connect to your Ansible container
Ansible Container in AMP
Save your port and IP address to connect to your Ansible Management Container
–>

Verify Installation

  1. Log into your Ansible Container
  2. Check Ansible information such as Ansible version, default configuration file location, and Python version: ansible --version

After installing your Ansible agent, start to learn Ansible IT automation with your first Ansible playbook (with an Ansible playbook example).

InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

Was this article helpful? Join the conversation!

Questions about our MailChannels Deployment? We have answers and are here to help!Learn More
+