GithubHelp home page GithubHelp logo

asmtal / rpi-terraform-bootsrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lachnerd/rpi-terraform-bootsrap

0.0 0.0 0.0 69 KB

Terraform script for bootstrapping vanilla raspian on raspberry pi for use as docker host

License: MIT License

Shell 38.93% HCL 61.07%

rpi-terraform-bootsrap's Introduction

Raspberry Pi Initialization with Terraform

This is for Provisioning a Rpi2/3 with Raspian Lite. I have implemented this for easily bootstrapping RPI Docker Hosts

Current Versions

  • Raspberry Pi 3B
    • Transcend Premium 300x 32GB
  • Raspian 2018-11-13-raspbian-stretch-lite
  • Docker 18.06.2ce3-0~raspbian
  • Terraform v0.11.11

Requirements

  • Raspberry Pi 2 or 3
  • SD Card
    • 16GB or better 32GB
  • SD Card Reader for flashing Raspian
  • FLash Program
    • balena Etcher
    • W32 Disk Imager
  • Rapsian Image
  • a DHCP Server for getting a IP-Adress

Manual Steps

Flashing Image

  • Take Flash Program
  • unpack Rapsian img-File
  • Flash it to SD-Card

Enable one-time ssh Access

  • disconnect reader or eject SD-Card and put it back in
  • create empty file 'ssh' in boot Partition

Startup Raspberry Pi

  • insert SD-Card in RPi
  • add network access
  • power it up
  • look in your Router & identify the IP-Adress of RPi
  • write that adress down

Terraform

Version used: Terraform v0.11.11

terraform.tfvars

Create a file "terraform.tfvars" for easy adding variable defaults. Te only variable that must be set is "ip_adress" for initial connection to Raspberry Pi. An Example File "terraform.tfvars.example" is included.

initialize

Before first use terraform modules must be initialized

   terraform init

plan

   terraform plan

apply

   terraform apply
  • approve with: yes
  • terraform will do the following
    • generate a tls key
    • copy public key to rpi
    • adds a new admin user
    • generate a new password
    • first connect with user & password
    • connect with private key

destroy

   terraform destroy

Not every single ressource has destroy abilities yet.

rpi-terraform-bootsrap's People

Contributors

lachnerd 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.