Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is what cloud-init[1], Puppet[2] et al a for. I haven't done this with shell scripts in at least 15 years.

[1] https://github.com/canonical/cloud-init

[2] https://www.puppet.com/



Have a look at ansible too, you can have what are called 'runbooks' to set up your server the way you want.

https://docs.ansible.com/ansible/latest/getting_started/intr...


I’ve written Java programs that write a bash script that runs under cloud init. It’s a lot less code than Puppet, it “just works” and you never hear that “you can’t get from there” or spend three days to find out how to configure something you could configure in three minutes if Puppet wasn’t involved.


I can't say Puppet has ever gotten in my way, but I've been using it for a very long time. I will admit it has a steep learning curve.


Just configured my first cloud-unit file and put it on a partitioned USB with the Ubuntu Server iso. It worked! Thanks for the heads up.


cloud-init looks great, I'll try it for new bare metal installs. How do you get it to work in Docker containers?


You don't use cloudinit with Docker containers. You'd use cloudinit to set up the Docker/K8s host on EC2 or similar IaaS.

Software for Docker containers is built like this: https://12factor.net/




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: