Skip to content

Collection of Ansible modules for managing Raspberry Pis

License

Notifications You must be signed in to change notification settings

colin-nolan/ansible-collection-rpi

Repository files navigation

Build Status

Ansible Collection - colin_nolan.rpi

Collection of Ansible modules for managing Raspberry Pis. Contains modules to:

  • Set kernel boot parameters in /boot/cmdline.txt (or similar files).

Installation

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

Usage

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

Development

Test

make test

Requires: pip install -r tests/unit/plugins/requirements.txt.

Linting

make lint

Requires: pip install -r requirements.style.txt.

Apply Format

make format

Build Distributable

make build

Requires: see Linting.

CI

The drone CLI can be used to run CI pipelines locally, e.g.

drone exec --pipeline=lint .drone.yml

Alternatives

  • escalate.cmdline: role for setting all parameters in /boot/cmdline.txt. Preserves root but resets all other parameters.
  • jm1.rpi_cmdline: role for setting all parameters in /boot/firmware/cmdline.txt.

Legal

MIT (contact for other licencing). Copyright 2023 Colin Nolan.

This work is in no way related to any company that I may work for.

About

Collection of Ansible modules for managing Raspberry Pis

Resources

License

Stars

Watchers

Forks

Packages

No packages published