Coder Social home page Coder Social logo

ansible-raspi-config's Introduction

raspi_config

Forked from https://github.com/mikolak-net/ansible-raspi-config.git

Ansible Role Ansible Role

A configuration role for Raspbian-based Raspberry Pi machines. Provides the following features:

  • exposes and/or emulates those raspi-config options that are most relevant to headless servers (see Rule Variables),
  • allows to add user-specified settings to /boot/config.txt via the raspi_config_other_options variable,
  • warns about leaving the default credentials accessible.

Additions

  • hostname is set from inventory_hostname
  • raspberry is completely redefined (network, boot-config, internationalisation, interfaces(spi,1Wire, etc), overclock, advanced (hdmi, overscan, gpu mem split ))
  • log2ram and zram are available for selection

Requirements

pip3 install "ansible-lint[core,yamllint]"

None, other than installing the role itself. To do that, create a requirements.yml file next to your playbook with the following contents:

- name: mikolak-net.raspi_config

(note the _ underscore instead of the - hyphen in raspi_config)

and then run:

ansible-galaxy install -r requirements.yml

The role and its dependencies should be now installed and ready to reference in your playbook via the name given in the requirements file.

Note: you can also install the role directly:

ansible-galaxy install mikolak-net.raspi_config

but creating a requirements file is just good practice.

Role Variables

All user variables reside in defaults/main.yml. Currently the following are available:

# perform full update+upgrade
raspi_config_update_packages: yes
# have the FS fill the SD card
raspi_config_expanded_filesystem: yes
# how much memory should be owned by the GPU (vs RAM)
raspi_config_memory_split_gpu: 16
#currently sets Pi2 OC setting if applicable
raspi_config_ensure_optimal_cpu_params: yes
# set global locale
raspi_config_locale: en_US.UTF-8
# set timezone
raspi_config_timezone: UTC
# list of services that should be restarted if the timezone is changed
raspi_config_timezone_dependent_services: []
# set hostname
raspi_config_hostname: pi
# ensure camera support is on - CURRENTLY UNVERIFIED
raspi_config_enable_camera: no
# specify whether to fail deployment when user/password is default
# ignored if "raspi_config_replace_user" is set (warning will still display)
raspi_config_fail_on_auth_test: yes
# user to replace the default "pi" user with
# NOTE: if you use this for the first time as "pi", any post_tasks will fail!
raspi_config_replace_user:
  name:
  path_to_ssh_key: #LOCAL path to your public key file
# wait this many seconds before forcing connection retry after reboot
raspi_config_reboot_max_wait_time: 300
# use this to add any additional options to the config in raw form
raspi_config_other_options: {}

Dependencies

See dependencies in meta/main.yml.

Example Playbook

- hosts: pi*
  remote_user: pi
  become: true
  roles:
     - role: mikolak-net.raspi_config
       raspi_config_replace_user:
         name: mainuser
         path_to_ssh_key: "~/.ssh/my_pub_key_id_rsa.pub"

License

BSD

Author Information

Issues should be reported on the project page.

Thanks to:

ansible-raspi-config's People

Contributors

colin-nolan avatar eberkund avatar edgd1er avatar greenthegarden avatar mikolak-net avatar skorfulose avatar stefangweichinger avatar

Watchers

 avatar  avatar

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.