From b478f515c9f893c6e7b70ac142ab91d7d3837e33 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Wed, 3 Oct 2018 15:34:01 +0200 Subject: raspbian-template: add rpi example role --- roles/raspbian-template/README.md | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 roles/raspbian-template/README.md (limited to 'roles/raspbian-template/README.md') diff --git a/roles/raspbian-template/README.md b/roles/raspbian-template/README.md new file mode 100644 index 0000000..7a91651 --- /dev/null +++ b/roles/raspbian-template/README.md @@ -0,0 +1,55 @@ +raspbian-template +================= + +About +----- + +This is a template for an ansible role setting up a +[Raspberry Pi][rpi] running [Raspbian][raspbian]. + +[rpi]: https://www.raspberrypi.org +[raspbian]: https://www.raspbian.org + +Bootstrap a new Raspberry Pi +---------------------------- + +Download a "Lite" image from the Raspberry Pi [homepage][downloads], +and write it to your sd-card as described on that page. + +Before removing the sd-card from your computer make sure to mount +the vfat filesystem on the first partition and create an (empty) +file called "ssh". This enables an [SSH][ssh] daemon on boot so +you and Ansible can log into it on boot. + +Now move your sd-card to the Raspberry Pi, connect an ethernet cable +and lastly the power. +Once you figure out the ip address of the Raspberry Pi you can run +the following command to bootstrap it: + +```sh +ansible-playbook -D \ + -i raspbian-template, \ + -e ansible_host= \ + -e ansible_ssh_user=pi \ + -e ansible_ssh_pass=raspberry \ + raspbian-template.yml +``` + +Now go buy a Mate or something. This will take a long time.. + +Once it finishes you should have a fully upgraded Raspbian +with all the Labitat users and their ssh keys in place. +Hence you should now be able run ansible with your own +ssh user. Eg. just + +```sh +ansible-playbook -D \ + -i raspbian-template, \ + -e ansible_host= \ + raspbian-template.yml +``` + +Now is a good time to ssh into it and reboot it, +so it uses the new network setup after boot. + +[ssh]: https://en.wikipedia.org/wiki/Secure_Shell -- cgit v1.2.1