Git Product home page Git Product logo

ansible-role-raspberry-pi's Introduction

Ansible Role: Raspberry Pi

CI

Configures a Raspberry Pi (running Raspbian).

This role will reconfigure certain options in the Raspberry Pi configuration files, but will not automatically restart the Pi to make all the changes take effect. For most changes, you'll need to make sure to reboot your Pi(s) after this role runs.

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

raspberry_pi_boot_config_options:
  # Set the GPU memory split value.
  - regexp: "^#?gpu_mem"
    line: "gpu_mem=16"
  # Enable 1200ma USB current on newer model Pis.
  - regexp: "^#?max_usb_current"
    line: "max_usb_current=1"

Use Ansible's lineinfile module to ensure certain settings are configured inside /boot/config.txt.

raspberry_pi_rc_local_options:
  # Disable HDMI on startup (for power savings).
  - regexp: "^/usr/bin/tvservice"
    line: "/usr/bin/tvservice -o"

Use Ansible's lineinfile module to ensure certain settings are configured inside /etc/rc.local.

Dependencies

None.

Example Playbook

- hosts: pi
  vars_files:
    - vars/main.yml
  roles:
    - { role: geerlingguy.raspberry-pi }

License

MIT / BSD

Author Information

This role was created in 2015 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-raspberry-pi's People

Contributors

geerlingguy avatar protitude avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-raspberry-pi's Issues

Any raspbian docker image for molecule?

Hello, sorry because I think this is not exactly related to this repo, but I've been searching and cannot find a better place to ask...

I'm building an Ansible collection for configuring a rpi4b, and I'd love to be able to test it with molecule, but I cannot find any base image that can be executed in an x86_64 host, and that is properly maintained.

I see you maintain several docker test images, and also some rpi roles, and I wonder if you have this on your rodamap or if there's another strategy for these cases...

Thanks, and sorry again for the noise.

Add variable for setting backrefs

While inspecting raspberry-pi-dramble/tasks/cgroup-features.yml (0af982d), there's the following:

- name: Enable required cgroup features.
  lineinfile:
    path: /boot/cmdline.txt
    backrefs: True
    regexp: '(^.+rootwait(\s+(?!cgroup_enable=cpuset cgroup_enable=memory)[\w=/\-\.]+)*)\s*$'
    line: '\1 cgroup_enable=cpuset cgroup_enable=memory'
    state: present

This code block code be replaced by this role and with the following variable definition

raspberry_pi_boot_config_options:
  # Enable required cgroup features.
  - regexp: '(^.+rootwait(\s+(?!cgroup_enable=cpuset cgroup_enable=memory)[\w=/\-\.]+)*)\s*$'
    line: '\1 cgroup_enable=cpuset cgroup_enable=memory'
    backrefs: True

However, the backrefs: True does not exist as an option today. Happy to contribute a PR to add this, but wanted to get some feedback on this change first.

Automatically reboot?

If most of the changes that can be made with this role requires a reboot to take effect, does it make sense to just automatically reboot the Pi and wait for it to come back online before continuing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.