This repository contains a collection of Ansible
playbooks for my needs.
Control machine
- Python 3 (≥3.8)
- Ansible (≥2.10)
Target hosts
- Python 3 installed (Ansible’s default connector uses
/usr/bin/python3
) - SSH access
The instructions to install Ansible
under Ubuntu
can be found
here.
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
For macOS
it can be installed via brew
brew install ansible
https://github.com/krahlos/ansible.krahlos.git
cd ansible.krahlos
By default it contains
[all]
localhost ansible_connection=local
To target remote servers replaye localhost
with their hostnames or IPs.
Before touching or destroying anything check the syntax
ansible-playbook site.yml --syntax-check
And because we are a little paranoid we do a dry-run
ansible-playbook site.yml --check --diff
Once we are happy with the outcome of the previous step we can run the playbook
ansible-playbook site.yml