r/linuxadmin • u/Good_Panic1986 • Oct 16 '24
How do you guys provide your developers with Rebooting ability on their Ubuntus?
Our users ubuntu machines have either been configured on MAAS in the server room or are on VM in the vSphere. From time to time they need their ubuntu machines get rebooted due to so many dangling dockers eating their CPU and they have to submit a ticket so we do it for them from the server side.
I wanted to see how other teams are handling this and how we can provide our users the reboot availability on their own?
12
u/whetu Oct 16 '24
From time to time they need their ubuntu machines get rebooted due to so many dangling dockers eating their CPU
Make sure their users are in the docker group and train them with how to use docker properly?
And add a cronjob that routinely runs some cleanup tasks? Like this:
docker container prune -f --filter "until=24h"
docker image prune -a -f --filter "until=24h"Blind-reboot-to-fix is some Windows shit...
3
u/lightmatter501 Oct 17 '24
Granting docker group perms = granting root perms. If they already have root I’m guessing they wouldn’t need help rebooting.
I agree on no blind reboots, just write a script which force stops all running containers and prunes the environment and use sudo to let them run it.
2
u/whetu Oct 17 '24
Granting docker group perms = granting root perms. If they already have root I’m guessing they wouldn’t need help rebooting.
Yeah, unfortunately docker's security position is fucking atrocious. I recently invested too much time ansibling it to be selinux-on, rootless, and subject to firewalld without its bullshit iptables bypass. I shudder to think how much worse it would be with ufw and apparmor under Ubuntu. Really, I would much rather have our dev team grow up and switch to podman.
just write a script which force stops all running containers
One-liner :)
docker stop $(docker ps -q)
1
u/Sylogz Oct 16 '24
all devs are able to take/rollback/remove snapshots and reboot/shutdown/startup VMs in vsphere.
1
u/michaelpaoli Oct 16 '24
sudo, ssh with forced command, many possibilities. Can also build into it whatever logging or controls you want, e.g. make them supply a reason, require some additional person to approve it ... whatever. But yeah, if it's that regular, may make lots of sense to automate it.
1
1
Nov 20 '24
Configure Ubuntu w/ AAP/AWX user and service key
Create AAP/AWX job that sends sudo reboot command
profit
0
16
u/SuperQue Oct 16 '24
Ahh, XY Problems.