Ansible: Install
Ubuntu 22.04
- Update your package index:
sudo apt update
- Install Ansible:
sudo apt install ansible -y
- Verify installation:
ansible --version
macOS (using Homebrew)
- Install Homebrew if you don't have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Ansible:
brew install ansible
- Verify installation:
ansible --version
Windows
Ansible runs natively on Unix-like systems. On Windows, use Windows Subsystem for Linux (WSL):
- Enable WSL and install Ubuntu from Microsoft Store.
- Open Ubuntu (WSL) and follow Ubuntu installation steps above:
sudo apt update
sudo apt install ansible -y
ansible --version
Alternatively, for advanced users, you can use pip in PowerShell (for WSL-less install, but some features may not work):
pip install ansible
ansible --version
Now Ansible is installed and ready to use on your system.