Skip to main content

Ansible Installation

Ansible is a powerful automation platform for configuration management, application deployment, and orchestration that you’ll use extensively in HackerOps labs.

Info

Pre-configured VMs: Ansible is already installed on the HackerOps Ubuntu VMs. Skip this guide if using the pre-configured environment.

What is Ansible?

Ansible allows you to:

  • Automate server configuration without agents
  • Deploy applications consistently across environments
  • Orchestrate complex workflows with playbooks
  • Manage cloud resources alongside Terraform

Official Documentation: Ansible Installation Guide

Installation Methods

Verify Installation

After installation, verify Ansible is working:

Terminal window
# Check version
ansible --version
# Should output something like:
# ansible [core 2.14.0]

Basic Usage Test

Test your installation with a simple ping:

Terminal window
# Test local connection
ansible localhost -m ping
# Should output:
# localhost | SUCCESS => {
# "changed": false,
# "ping": "pong"
# }

Tip

Success! If you see β€œpong” in the response, Ansible is properly installed and ready for the labs.

Next Steps

With Ansible installed:

  1. Set up cloud platforms - Configure AWS, Azure, and DigitalOcean
  2. Start Lab 1 - Begin with infrastructure automation
  3. Learn Ansible basics - Practice with playbooks in the labs

Troubleshooting

Command not found:

  • Restart your terminal after installation
  • Check if Ansible is in your PATH: echo $PATH
  • Try reinstalling using pip: pip3 install ansible

Permission errors:

  • Use sudo for Ubuntu package installations
  • On macOS, try: brew doctor to check Homebrew setup

Python errors:

  • Ensure Python 3.6+ is installed: python3 --version
  • Update pip: python3 -m pip install --upgrade pip