~/CloudSetup.In

Ansible

Configuration playbook.yml ● stable

Agentless configuration management and application deployment.

01 Overview

Ansible connects over SSH and applies YAML playbooks to bring servers into a declared state — installing packages, templating config files, restarting services — with no agent required on the target hosts.

→ official documentation

02 Installation

Pick a platform. Each step is copy-pasteable on its own.

01  Update package index
sudo apt update
02  Install the PPA (optional, latest release)
sudo apt install -y software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
03  Install Ansible
sudo apt install -y ansible
04  Verify
ansible --version
01  Enable EPEL
sudo dnf install -y epel-release
02  Install Ansible
sudo dnf install -y ansible
03  Verify
ansible --version
01  Install via Homebrew
brew install ansible
02  Verify
ansible --version
Note — commands assume sudo privileges and an up-to-date package index. Pin a specific version in production rather than tracking latest.

03 Install script

The steps above bundled into a single idempotent shell script for provisioning boxes unattended.

install-ansible.sh
Ubuntu/Debian target · safe to re-run · exits non-zero on failure
↓ download script

04 Cheatsheet

The commands reached for most often once Ansible is installed.

CommandWhat it does
ansible all -m ping -i inventoryCheck connectivity to all hosts
ansible-playbook site.ymlRun a playbook
ansible-playbook site.yml --checkDry-run without making changes
ansible-playbook site.yml --limit webRun against one host group
ansible-vault encrypt secrets.ymlEncrypt a file with Ansible Vault
ansible-galaxy install role_nameInstall a role from Galaxy
ansible-inventory --listPrint the resolved inventory as JSON