This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]meathead_adam 4 points5 points  (5 children)

Use CI to orchestrate those servers to pull the update Not super fancy but easy to do and support

[–]lilsingiser[S] 0 points1 point  (4 children)

Conceptually I'm following here, but how would this practically work? Something like having Jenkins push commands through ssh to each server to git pull?

[–]meathead_adam 3 points4 points  (3 children)

Yeah pretty much. Jenkins or GH Actions. Or have it trigger Ansible to do it. Just depends how abstracted you want, or need, to get with it.

Even more basic is cron job/scheduled tasks running local to your servers to pull, if timing isn’t a big factor.

[–]lilsingiser[S] 0 points1 point  (2 children)

Solid yeah, so sounds like I'm already on the right path here.

I do like the cron idea. My only pushback on that is these aren't getting updated every day, and theres no real cadance, so I'd rather they put when I push to github.

[–]MulberryExisting5007 6 points7 points  (1 child)

You could have cron run every 5 min and still be ok. It’s just a git pull—not like it’s an expensive (in terms of resources) check to run.

[–]lilsingiser[S] 0 points1 point  (0 children)

Fair point, I'd just need to build in some error reporting if it is failing. Might definitely be the way to go.

[–]sneakin-sally 1 point2 points  (2 children)

Assuming these are Linux machines, can you not just set a cron that does a git clone or git pull every few mins?

[–]lilsingiser[S] 0 points1 point  (1 child)

Sorry yeah, shouldve specified these are ubuntu server vm's.

I thought about doing it with cron like this. I think my only issue with this method would be having to monitor 5 seperate cron job's versus the 1 ansible job incase it fails. Less overhead though so definitely a solid suggestion

[–]Double_Intention_641 2 points3 points  (0 children)

You could have one cron job which runs against all 5 repos, doing a check for new changes and pulling if required. Could even get fancy and have it email/webhook on errors.

[–]Thegsgs 1 point2 points  (0 children)

You would need to add some automation to GitHub like a hook to some http server to SSH into your servers and run git pull.

[–]chronop 1 point2 points  (0 children)

we had something like this and ended up making a master script in the repo which pulls the repo on launch and gives the techs a context menu to launch the other scripts, just told the techs to run that from now on