scottmuc / infrastructure

Documentation / Automation for personal third-party infrastructure
The Unlicense
11 stars 2 forks source link

Rebuild Raspbery PI - First repave with new ansible automation #33

Closed scottmuc closed 2 years ago

scottmuc commented 2 years ago

Yay for Repaving!

As much as possible is documented inline in this issue template. In case of problems you may find help by viewing all the previous repave issues. Have fun!

Things to do with the existing build

Post OS install steps on the PI

Post OS install steps on desktop

scottmuc commented 2 years ago

Need step to change default pi user password.

Also think I can create a bootstrap and apply subcommand of the ./ansible.sh script to remove code from this issue template.

scottmuc commented 2 years ago

First run of ansible stopped with a failure to launch unbound. I was able top stop/start the service manually though.

scottmuc commented 2 years ago

Second run of ansible stopped at acquiring certificates. Need to re-add port forwarding to the random DHCP address.

scottmuc commented 2 years ago

Third run of ansible stopped at starting nginx. I forgot that I've been updating the server_names_hash_bucket_size manually each time. It's not automated yet as I'm uncertain how to make this change (though I think ansible has a useful line change feature).

scottmuc commented 2 years ago

Fourth run of ansible succeeded! Re-added the port mapping and deployed goodenoughmoney and it's live.

scottmuc commented 2 years ago

Manually ran the navidrome.sh script on the pi and now https://home.scottmuc.com/music/ is working.

scottmuc commented 2 years ago

Manually ran sudo smbpasswd -a pi with the same password as before and my Z: drive on Windows can still access the files.

scottmuc commented 2 years ago

Manually enabled the dhpcd on the PI.

Seeing messages in /var/log/syslog:

Mar 13 08:48:50 raspberrypi kea-dhcp4[1727]: Unable to use interprocess sync lockfile (No such file or directory): /var/run/kea/isc_kea_logger_lockfile

ipconfig /renew on my Windows PC isn't working so I've stopped the service and re-enabled DHCP on my router for now.

scottmuc commented 2 years ago

Something I realised is that I should not have overlapping DHCP IP address pools configured in my PI and my Telekom router.

Now my network looks like the following:

192.168.2.0/24

scottmuc commented 2 years ago

Looks like I can remove all bootstrapping terminal access to the PI if I follow some of the directions here: https://kenfallon.com/safely-enabling-ssh-in-the-default-raspbian-image/.

I'll definitely try that in the next repave.

scottmuc commented 2 years ago

I need to learn how setup and notify handlers in Ansible. It might add a bit of complexity, but I believe it would make re-runs more reliable in their outcomes (e.g.: signal a restart of a service when the resource is observed as changed).

Also, need to stick with a consistent syntax for package resource specifications. Some places the inline style is used, and in other places, the yaml syntax is used.

scottmuc commented 2 years ago

Repave Complete!

Notes for the next repave: