How to Keep Multiple Git Repos in Sync Across Servers?

0
3
Asked By Techie1234 On

Hey everyone! I need some guidance on managing multiple servers. I've got five servers that my technicians access to run scripts remotely, and these scripts are all version controlled in a single repo. The scripts are all about automating the configuration of various devices in a staging environment.

I'm looking for a way to keep all five of these servers synced with my GitHub repo. Ideally, I want to push updates from my local machine to GitHub, and then have all servers automatically pull the latest updates from there.

I don't think containerization is the way to go here, but I'm open to any input on that. Right now, I'm considering using Ansible in conjunction with a CI/CD pipeline to manage the updates. Any other suggestions or insights on how best to approach this would be much appreciated!

2 Answers

Answered By CIWhiz On

You might also want to consider using a CI tool to orchestrate the updates. It can trigger the servers to pull the latest code when changes are pushed to GitHub. Not the flashiest solution, but it’s reliable and easy to manage.

Answered By DevGuru79 On

If these servers are running Linux, you could set up a cron job on each one to do a `git pull` every few minutes. It's a straightforward solution to keep things synced without too much hassle.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.