Collection of Ansible modules for managing Raspberry Pis. Contains modules to:
- Set kernel boot parameters in
/boot/cmdline.txt
(or similar files).
This collection is not yet published on Ansible Galaxy but it can be installed from GitHub.
If you are using a requirements.yml
file
collections:
- name: git+https://github.com/colin-nolan/ansible-collection-rpi.git,1.0.1
else install from the command line using:
ansible-galaxy collection install git+https://github.com/colin-nolan/ansible-collection-rpi.git,1.0.1
Create a task in your role/playbook that uses the module, e.g.:
- name: Set kernel boot parameters
become: true
colin_nolan.rpi.boot_cmdline:
state: present
items:
cgroup_memory: 1
cgroup_enable: memory
key_only: null
notify: reboot
It is likely you will want to reboot handler to apply any changes, e.g.:
- name: Reboot the machine
become: true
ansible.builtin.reboot:
listen: reboot
make test
Requires: pip install -r tests/unit/plugins/requirements.txt
.
make lint
Requires: pip install -r requirements.style.txt
.
make format
make build
Requires: see Linting.
The drone
CLI can be used to run CI pipelines locally, e.g.
drone exec --pipeline=lint .drone.yml
escalate.cmdline
: role for setting all parameters in/boot/cmdline.txt
. Preservesroot
but resets all other parameters.jm1.rpi_cmdline
: role for setting all parameters in/boot/firmware/cmdline.txt
.
MIT (contact for other licencing). Copyright 2023 Colin Nolan.
This work is in no way related to any company that I may work for.