Giter Club home page Giter Club logo

raspi_config_sh's Introduction

Scripts to configurate an Raspberry

Set of 3 scripts to facilitate the configuration of a Raspberry (Functional with OS Raspbian Lite on MacOS)

Prerequisites

  • Docker
  • A Raspbian SD card (Raspberry Pi Imager to configure it quickly)
  • If you work MacOS, you need a utility to read partition in ext4 format

Usage

Script 0: Activate the ssh and assigned a static IP

You must fill in the config.ini file with your data

# wpa_supplicant.conf
# necessary if you want to configure wifi
#
RASPCT_country="Your country"
RASPCT_ssid="connection name"
RASPCT_psk="wifi code"


# dhcpcd.conf
#
RASPCT_ip_address=<Ip address ex: 192.168.1.15>
RASPCT_routers=<routers ip>
RASPCT_domain_name_servers="dns ip  ex: 192.168.1.1 8.8.8.8"

Then run the script 00_pre_boot_.sh

For these example the boot partition of the SD card is mounted on /Volumes/boot and the system partition /Volumes/rootfs

  • Example for activated WiFi:
./00_pre_boot.sh -b /Volumes/boot -s /Volumes/rootfs -w 
  • Example for activated Ethernet:
./00_pre_boot.sh -b /Volumes/boot -s /Volumes/rootfs 

Script 1: Generate an ssh key to allow a connection with the ansible server:

./01_ssh_key.sh -t <Raspberry IP>

This script uses the default credentials to connect to the raspberry
It is possible to change the default credentials by using the options -u < user > and -p < password >

Script 2: Configuring raspberry with ansible

./02_launch_ansible.sh

This script launches a playbook named config.yml (found in ansible/playbook/config.yml).
The host file is located in ansible/inventory/hosts.json, default value:

  • "ansible_host": "raspberrypi"
  • "ansible_port": 22
  • "ansible_user": "pi"

The playbook uses a configuration role which allows:

  • creating a new user and deleting the "pi" account
  • change ssh port
  • activate or deactivate the raspberry I/O (serial, camera, vnc, spi, i2c etc ...)
  • install packages
  • activate the firewall
  • open ports

For more details on the role variable

License

MIT

raspi_config_sh's People

Contributors

m0by314 avatar

Watchers

 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.