alysko
Posts: 7
Joined: Wed Mar 13, 2013 4:23 pm

deploying many rpi

Tue Apr 07, 2020 12:04 pm

Hi,
I have 6 rpi4 to deploy, with some packages and configurations. I would like not to repeat operations for all of them.
As I understand it, Ansible can achieve a part of that without having to install any agent.
But ansible need a ssh connection, so I have to configure it for each rpi. How can I pre-configure this? Is there a way to deploy ssh connections with password and cert?
Thanks.

swampdog
Posts: 379
Joined: Fri Dec 04, 2015 11:22 am

Re: deploying many rpi

Wed Apr 08, 2020 11:32 pm

I left the industry proper before DevOps became de-facto so can't help with that.

What I do when writing images is have a script mount the image prior to writing to the sdcard and (amongst other things) adjust the hostname, enable ssh and /etc/rc.local then put a script in there which completes the installation then deletes itself. Part of that installation creates a new account with passwordless 'sudo' rights.

That account invokes 'ssh-keygen' but it could as easily use a clone of existing keys. As there's only six of them I'd simply set up one sdcard then copy that image back. Mount the image, adjust /etc/hostname and write to next sdcard. With a common key on that account then perhaps Ansible can do the rest?

alysko
Posts: 7
Joined: Wed Mar 13, 2013 4:23 pm

Re: deploying many rpi

Fri Apr 10, 2020 8:22 am

I would have liked something more... elegant. But I'll probably do something like this. Thanks.

Return to “Networking and servers”