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.1else install from the command line using:
ansible-galaxy collection install git+https://github.com/colin-nolan/ansible-collection-rpi.git,1.0.1Create 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: rebootIt is likely you will want to reboot handler to apply any changes, e.g.:
- name: Reboot the machine
become: true
ansible.builtin.reboot:
listen: rebootmake testRequires: pip install -r tests/unit/plugins/requirements.txt.
make lintRequires: pip install -r requirements.style.txt.
make formatmake buildRequires: see Linting.
The drone CLI can be used to run CI pipelines locally, e.g.
drone exec --pipeline=lint .drone.ymlescalate.cmdline: role for setting all parameters in/boot/cmdline.txt. Preservesrootbut 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.