A set of Ansible playbooks to configure a Raspberry Pi. These use Podman for running containers on the Pi.
These playbooks currently support Ubuntu 22.04 LTS (64-bit) on Raspberry Pi 4 devices.
- baseline_ubuntu.yml - Standard setup for Ubuntu
- cockpit_linux.yml - Cockpit Web interface for administration
- podman_ubuntu_host.yml - Add Podman to Ubuntu
- update_ubuntu.yml - Apply operating system updates
- podman_node_red.yml - Run a Node-RED container with Podman
To set up Ansible on the computer that will manage the Raspberry Pi devices:
- Clone this Git repository to the computer.
- Install Ansible on the computer
- Edit the inventory to list your Raspberry Pi devices
You can then run the Ansible playbooks.
Install Ansible:
pip3 install --user pipx
pipx install ansible-core
ansible-galaxy install -r requirements.yml
Edit the file inventory/hosts. For each Raspberry Pi device, list the IP address of the device and the name of your user account on that device.
Always use syntax-check to validate a playbook before you run it:
ansible-playbook --syntax-check -i inventory/hosts baseline_ubuntu.yml
To carry out a dry-run of a playbook, use --check to enable check mode:
ansible-playbook --check -i inventory/hosts update_ubuntu.yml
To run a playbook:
ansible-playbook -i inventory/hosts update_ubuntu.yml
To check that Ansible can successfully connect to the devices in the inventory, use the ping module:
ansible -m ping -i inventory/hosts all
To get the Ansible facts for the devices, use the setup module:
ansible -m setup -i inventory/hosts all > all.txt