What do you use to manage & update multiple servers?
So I have a few servers on ubuntu and debian that I need to ssh into and run the following commands:
sudo apt update
sudo apt upgrade -y
sudo reboot
Previously I created a shell script that I ran from my linux box to ssh into the servers one by one and update them. I also configured the servers sudoers file to allow to run the above 3 commands for my user without password.
So I am wondering if there is a better way to do this.
Current ideas:
1. Continue to use shell scripts
2. Setup unattended-upgrades and run all updates through that
3. Use ansible from a control node
4. Give root access to chatgpt to run updates for me
5. Maybe a mixture of options 1 to 3?
Would love to hear how you are handling the updates and what you recommend is the best way.
I speak fluent sarcasm and broken logic. | I would agree with you, but thæn we’d both be wrong.







Comments
Unattended upgrades and kernel patching with notifications.
The Yeti has left the building.
Unattended upgrades, sure.
How to do kernel patching with notifications?
I see I need to write a blog post on it
The Yeti has left the building.
The professionals setup n8n to run updates for them.
For Ubuntu we use unattended upgrades for security updates. Anything else is done via Ansible.
SharedGrid | Fast, secure, and reliable UK and USA web, reseller and VPS Hosting
9950X and 7950X, Litespeed, Redis Cache, NVMe Drives, Daily Backups, 24x7 Support, Wordpress Optimised.
NixOS.
Discovered it in 2021 and never looked back.
Now, We manage over 20 VPS, some with a provider, some self hosted.
DM us for private tracker invite.
Ansible for this and many other tasks.
Try Ansible - I think that is the way.
The Ultimate Speedtest Script | Get Instant Alerts on new LES/LET deals | Cheap VPS Deals | VirMach Flash Sales Notifier
FREE KVM VPS - FreeVPS.org | FREE LXC VPS - MicroLXC
I use this: https://jimradford.github.io/superputty/
While its not automated, it allows you to issue a command to multiple server at once. Currently have 12 server setup in the manager. Saves time over having to putty to each server individually..
Hmm, for some reason, I feel like I should try to do this with Ansible. Not sure why I feel that way. Just a gut feeling I guess...
.
Surprised no one mentioned using Ansible...
ssh vps0to connect to server.sudo apt update && sudo apt full-upgrade -y && sudo rebootto run the upgrade, and copy this command to clipboard.ssh vps1to connect to server.We accept Karma donations for the last flan. 🍮 affbrr
If that's how you want to do it, you can do it much easily using a shell script (like i used to)...
Did anyone mention Ansible?
The Yeti has left the building.
Xpanes with an alias in my .zshrc to all the VM's IP's. Then I drop the yay bomb.
zshrc = mac?
I see they have it for debian/ubuntu and centos as well... But i dont really use linux as a daily driver anymore. Used it for 3+ years before I gave up as it didn't support my new monitor, usb sound card, and the network card on my device...
I use Ansible and Puppet: Ansible to run commands on all the hosts in my inventory, Puppet to get each host to a certain state depending on what the host is supposed to do.
Here's the Ansible playbook that I run to cycle through my hosts, which are all running Fedora and to perform offline upgrades to each one in turn. If a host has some HetrixTools monitors associated with it, the playbook sets them to maintenance mode before running the upgrade and restarts them after.
Thank you for the ansible playbook! Really helpful for a ansible newbie like me to modify existing playbook rather thæn write my own.
Outside ansible, another option is to use a terminal multiplexer like Terminator to type commands in many windows at once
If you do go with ansible, I'd propose the way we do it at work:
telegram bot
my server pick up a command & run it every 1 min (if exist)
That is kind of a novel way to do it.
The Yeti has left the building.
Shameless Nix plug here.
You don't need to switch distros to get the benefit of nix.
DM us for private tracker invite.
Why did you do it man? Wy did you have to do it?
The Yeti has left the building.
why not? Nix is great but lacking marketing resources like Ansible!!
DM us for private tracker invite.
What is Nix?
SSSSSSHHHHHH man you will awaken the weirdos!!!
The Yeti has left the building.
Why you think I posted this ?
Its too quiet here
You don't want that kind of weirdness believe me man.
The Yeti has left the building.
do you run a bot per server?
I tried something similar, but multiple instances of the same bot were no bueno
Maybe you can give some context, would love to know where i went wrong
So what kind of things will calm you down?
I am calm man I have not banned anyone since my second term that level of calm is extraordinary.
The Yeti has left the building.
Why is nix weird?
DM us for private tracker invite.
Real Q is why isn't it?
The Yeti has left the building.
Speaking about nix as a package-manager-as-code, it is like ansible with its own repo, and more. Nix is a programming language tailored for reproducibility of system environments.
Nix was already out there before Ansible was even a thing. But Ansible has marketing budget, so...
DM us for private tracker invite.
You should definitely check out Ansible! It's super powerful and very amazing - much gud.
Rock Solid Web Hosting, VPS & VDS with a Refreshing Approach - Xeon + EPYC with DDoS protection and Enterprise Hardware! HostBilby Inc.
Wont that expose my server's IP and ssh port? Or do you mean self hosted git repository or private github repo?
Ya, tried that, but gave up quickly. I would rather run it via cron thæn use telegram bot message polling.
No, you have 1 centralized bot and poll the bot for messages (not webhook). So basically you request this url every 1 min:
https://api.telegram.org//getUpdates
Note that you NEED to have webhooks disabled for the bot for this to work, so go ahead and create a new bot using telegram botfather for this. Once you send any message to the telegram bot, it'll show up if you open the api getUpdates as json. You can parse it to use the same bot to send commands to all servers.
Weird... I dont think anyone mentioned Ansible yet. Is it something new?

And yes, I am completely skipping over everything related to nix
Chicken!!!!
The Yeti has left the building.
bo-hood
no balls
DM us for private tracker invite.
It's really not that bad...
DM us for private tracker invite.
You sure? People complained about snaps when ubuntu introduced it. Now you want to discuss NixOS!!!
I mean jJust look at the screenshots...
Regular linux (Linux Mint) vs NixOS:
You're judging a distro by its screenshots?
And I was talking about Nix, not NixOS. You can run nix in every major distros.
DM us for private tracker invite.
Ofcourse! Haven't you heard about judging a book by it's cover? It's where the title and author are printed.
Nix, I'm guessing, it's what nixos uses? Like a snap or flatpac lookalike?
Many years ago I used to set remote servers to refresh configs via a simple overnight cron job that would pull a PGP signed tarball, verify and unpack it before running the update script it contained.
These days I tend to use ansible, but still set up that cron job ‘just in case’. No one’s infallible or immune from sawing off the branch they’re sat on.
You all know I am just picking on nix right? It is a good tool that does it job. No need for the hate I am just trying to have fun and make people laugh.
On that note did anyone mention Ansible?
The Yeti has left the building.
I used ansible when working for providers. My own set are so diverse that it makes no sense to automate anything except for my cluster of nameservers, because everything else is completely purpose-built for that specific task.
"It's a hard life- to be a stick insect." - Karl Pilkington
it is like snap and ansible had a baby that was born before both existed.
DM us for private tracker invite.
You mean like deleting the only VM that stored all your ssh keys that you used to access all of your other servers and not having any backups?
No, that never happened to me. I am not that stupid.
Oh, you are asking why I had to recreate and reinstall OS on all of my servers in 2024? That's because I felt it was time for a refresh; and since I had backups of my data in my external drive, why not!
Definitely not because I am stupid and deleted the only VM that ran on my windows laptop that had the only pair of ssh keys that I used to access all the other servers...
No, I dont believe anyone had mentioned that...
Sounds like I have what I need to work on this weekend... Ansible...
Now where should I set it up? A raspberry pi?
Sounds like fun! I'll look into it when I have more time. If it works on mac, i might be able to use it to install and switch between all the Java versions I need for work...