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 ansibleFor macOS it can be installed via brew
brew install ansiblehttps://github.com/krahlos/ansible.krahlos.git
cd ansible.krahlosBy default it contains
[all]
localhost ansible_connection=localTo target remote servers replaye localhost with their hostnames or IPs.
Before touching or destroying anything check the syntax
ansible-playbook site.yml --syntax-checkAnd because we are a little paranoid we do a dry-run
ansible-playbook site.yml --check --diffOnce we are happy with the outcome of the previous step we can run the playbook
ansible-playbook site.yml