My Ansible Playbook I use each time I reflash my Raspberry Pi's. The playbook automates:
- updating apt cache
- upgrading apt packages
- auto-removing obsolete apt packages
- Install a list of packages
- Create a user and add them as root
Install ansible
on the machine you plan to run this playbook on.
Since the ISO I use does not have python3
installed by default, make sure it's present.
This script is only built with Debian-based distro's in mind. Feel free to fork it if you want other package managers.
- Copy the example files to the same directory.
cp example.hosts.ini hosts.ini
cp example.vars.yml vars.yml
- Add hosts to
host.ini
- Add or remove packages in
vars.yml
- Add desired username to create.
- For the
password:
variable, runmkpasswd --method=sha-512
in a terminal and use the output from it. - Run it with
ansible-playbook -K playbook.yml
-
Automatically install Oh My ZSH.
-
Automatically add SSH keys