Created an ansible script to setup my homeserver - automated creation of portainer stacks reddit / selfhosted ---------------------------------------------------------------------- vicks9880 · 2023-11-25 13:13 I have been self hosting from quite a while and recently I had to restart my server. After restarting, for some reason portainer didn't recognise any of my stacks and all my stacks becaome "limited" and I lost all my docker\_compose for all services. So decided to create this ansible script which keep all my configuration in one place in case I have to reinstall my server. The script automates all my setup which used to take hours of work and now I can have everything up and running in minutes in case of failure. I am currently working on backing up configuration files for all my docker services to Mega (free plan) using MegaCMD Backup, which keeps a rotational backup of the files ( last 10 days in my case). Would like to share with all and hope to get some improvements/ideas: [https://github.com/vikramsoni2/homelab\_infra](https://github.com/vik ramsoni2/homelab_infra) ---------------------------------------------------------------------- osuhickeys · 2023-11-25 13:49 Very nice. I did something similiar, but with an Ubuntu image. You might look at Vagrant next to setup your base Debian OS with automation. And then look at Packer to create the base Debian OS Image that gets deployed with Vagrant. Very powerful tools that are fairly easy to use. It took me a couple of weeks to get Ansible, Vagrant, and Packer configurations working and everything setup the way I wanted it, but now I can rebuild from scratch in less than an hour and everything is basically documented in the config files. The hardest part actually was the cloud init for an unattended install of Ubuntu (nothing to do with Ansible, Vagrant, or Packer). ​ The other thing that was key was to put all of the application data on a separate volume and mount it to the new host when it is created so I was not having to spend hours doing a restore of the application data just because the OS got corrupted. ---------------------------------------------------------------------- vicks9880 · 2023-11-25 14:00 Thanks, I will take a look. I remember using vagrant for sandboxing my javascript apps during the time when docker arrived in the market. Haven't used it in a long time. But yeah, remote OS installation would be awesome ---------------------------------------------------------------------- DisastrousMagician16 · 2023-11-25 14:07 How much free storage does Mega give you? ---------------------------------------------------------------------- vicks9880 · 2023-11-25 14:12 I have 50GB free, but I believe they reduced it to 20GB for new users. Plenty enough for the application data. ---------------------------------------------------------------------- ThaCrrAaZyyYo0ne1 · 2023-11-26 06:37 !remindme 1 week ---------------------------------------------------------------------- RemindMeBot · 2023-11-26 06:38 I will be messaging you in 7 days on [**2023-12-03 06:37:27 UTC**](htt p://www.wolframalpha.com/input/?i=2023-12- 03%2006:37:27%20UTC%20To%20Local%20Time) to remind you of [**this link **](https://www.reddit.com/r/selfhosted/comments/183jhh9/created_an_an sible_script_to_setup_my_homeserver/kat16ug/?context=3) [**CLICK THIS LINK**](https://www.reddit.com/message/compose/?to=Remin dMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2F selfhosted%2Fcomments%2F183jhh9%2Fcreated_an_ansible_script_to_setup_m y_homeserver%2Fkat16ug%2F%5D%0A%0ARemindMe%21%202023-12- 03%2006%3A37%3A27%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)] (https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete %20Comment&message=Delete%21%20183jhh9) ***** |[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remind mebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?t o=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside %20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Yo ur Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot& subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](ht tps://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot %20Feedback)| |-|-|-|-|