[rancid] Help Using git with RANCID

Ryan Melville rmelville at otes.com
Wed Aug 22 14:40:54 UTC 2018


Thank you for the advice, which got me on the right track.  I think those commands probably would have worked as-is, but my ideal state was having RANCID's local git workspace wire directly back to my git server *only* and not also push to the local ($CVSROOT) git repo.

So my steps were the following, picking up after the "sudo -H -u rancid /mnt/rancid/rancid/bin/rancid-cvs" command:

1) Create new empty 'rancid-<group>' repository on my (external) master git server (Atlassian Bitbucket, in my case).

2) Create 'rancid' user on my master git server, and give it read/write permission to the new repo.

3) Store 'rancid' user git credentials on my RANCID server, which requires a temporary clone that is then immediately deleted.

sudo -H -u rancid git config --global user.name "rancid"
sudo -H -u rancid git config --global user.email "rancid@<mydomain>"
sudo -H -u rancid git config --global credential.helper store
sudo -H -u rancid git clone https://rancid@<my-git-server>/scm/rancid-<group>.git<https://rancid@%3cmy-git-server%3e/scm/rancid-%3cgroup%3e.git>
(enter 'rancid' user passwords when prompted)
sudo -H -u rancid rm -rf rancid-all

4) Re-wire RANCID's git workspace to the master git server, instead of its local git server/repo.  Uses my particular RANCID installation path and group name ("all").

cd /mnt/rancid/rancid/var/all
sudo -H -u rancid git remote set-url origin https://rancid@<my-git-server>/scm/rancid-all.git
sudo -H -u rancid git push -u origin --all
sudo -H -u rancid git push origin --tags


At this point, I made a change to a network device, waited for my next cron execution of rancid-run, and then observed the changes in my master git repo, so I believe it was all working well.

Regards,

Ryan Melville

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20180822/3529c2f9/attachment.html>


More information about the Rancid-discuss mailing list