Discussion:
[rancid] rancid git setup question
Dan Weintraub
2016-02-05 22:28:31 UTC
Permalink
Hi,

I’m a first time user having a question about making rancid work with git. I’m on CentOS 7 with rancid 3.3.0, perl v5.16.3, and git 1.8.3.1.

I read that "no attempt will be made to create the repository when running rancid-cvs” so I cloned my empty git repo into the rancid $BASEDIR and pointed at it in the rancid.conf:

CVSROOT=$BASEDIR/rancid-backups/; export CVSROOT

I then ran rancid-cvs, but I don’t understand the behavior. I would expect it to prepare the CVSROOT, but it made a new folder and repo named after my sole group. It then made a new folder in my intended git repo ($CVSROOT), with my group name, but it looks like a .git directory:

[***@rancid rancid-backups]$ ls -al
total 20
...
drwxr-x--- 7 rancid rancid 4096 Feb 5 22:01 myGroup
drwxr-xr-x 8 rancid rancid 4096 Feb 5 22:01 .git
-rw-r--r-- 1 rancid rancid 60 Feb 5 22:01 README.md
[***@rancid rancid-backups]$ ls -al myGroup/
total 40
...
drwxr-x--- 2 rancid rancid 4096 Feb 5 22:01 branches
-rw-r----- 1 rancid rancid 66 Feb 5 22:01 config
-rw-r----- 1 rancid rancid 73 Feb 5 22:01 description
-rw-r----- 1 rancid rancid 23 Feb 5 22:01 HEAD
drwxr-x--- 2 rancid rancid 4096 Feb 5 22:01 hooks
drwxr-x--- 2 rancid rancid 4096 Feb 5 22:01 info
drwxr-x--- 11 rancid rancid 4096 Feb 5 22:01 objects
drwxr-x--- 4 rancid rancid 4096 Feb 5 22:01 refs


When I run rancid-run, it puts the config files in the myGroup directory of the BASEDIR, but it also seems to touch some objects in the myGroup .git directory.

I then thought that I would only use the repo generated my rancid-cvs, so I put the CVSROOT back to default and tried again. It still makes a $CVSROOT/myGroup directory that doesn’t seem to make sense. I would appreciate it if someone could explain what’s going on or recommend some good documentation on getting rancid and git set up.

Thanks,
Dan





Dan Weintraub | Systems Engineer
V: 877.327.8422 x
mailto:***@dealer.com | www.dealer.com
heasley
2016-02-06 01:09:42 UTC
Permalink
Post by Dan Weintraub
Hi,
I’m a first time user having a question about making rancid work with git. I’m on CentOS 7 with rancid 3.3.0, perl v5.16.3, and git 1.8.3.1.
I need to make that clearer; no attempt will be made to create repos if
CVSROOT looks like a URL. the script does not handle remote repos.
ie: if you want the origin (if i have the parlance correct) to be on a
remote host, you must create it yourself. My suggestion would be that you
let rancid-cvs create the repo locally, then move that to your remote host
and update group/.git/config to reflect that.

CVSROOT does not translate well to git; for rancid's purpose, it puts all
of it origins - one per group - under CVSROOT. so CVSROOT/myGroup,
CVSROOT/youGroup, CVSROOT/groupies etc. And, the working directory is
BASEDIR/myGroup.

lmk if thats muddy ... or if i have a bug.
Post by Dan Weintraub
CVSROOT=$BASEDIR/rancid-backups/; export CVSROOT
total 20
...
drwxr-x--- 7 rancid rancid 4096 Feb 5 22:01 myGroup
drwxr-xr-x 8 rancid rancid 4096 Feb 5 22:01 .git
-rw-r--r-- 1 rancid rancid 60 Feb 5 22:01 README.md
total 40
...
drwxr-x--- 2 rancid rancid 4096 Feb 5 22:01 branches
-rw-r----- 1 rancid rancid 66 Feb 5 22:01 config
-rw-r----- 1 rancid rancid 73 Feb 5 22:01 description
-rw-r----- 1 rancid rancid 23 Feb 5 22:01 HEAD
drwxr-x--- 2 rancid rancid 4096 Feb 5 22:01 hooks
drwxr-x--- 2 rancid rancid 4096 Feb 5 22:01 info
drwxr-x--- 11 rancid rancid 4096 Feb 5 22:01 objects
drwxr-x--- 4 rancid rancid 4096 Feb 5 22:01 refs
When I run rancid-run, it puts the config files in the myGroup directory of the BASEDIR, but it also seems to touch some objects in the myGroup .git directory.
I then thought that I would only use the repo generated my rancid-cvs, so I put the CVSROOT back to default and tried again. It still makes a $CVSROOT/myGroup directory that doesn’t seem to make sense. I would appreciate it if someone could explain what’s going on or recommend some good documentation on getting rancid and git set up.
Thanks,
Dan
Dan Weintraub | Systems Engineer
V: 877.327.8422 x
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Dan Weintraub
2016-02-08 19:02:34 UTC
Permalink
Post by heasley
I need to make that clearer; no attempt will be made to create repos if
CVSROOT looks like a URL. the script does not handle remote repos.
ie: if you want the origin (if i have the parlance correct) to be on a
remote host, you must create it yourself. My suggestion would be that you
let rancid-cvs create the repo locally, then move that to your remote host
and update group/.git/config to reflect that.
CVSROOT does not translate well to git; for rancid's purpose, it puts all
of it origins - one per group - under CVSROOT. so CVSROOT/myGroup,
CVSROOT/youGroup, CVSROOT/groupies etc. And, the working directory is
BASEDIR/myGroup.
So, if I change the origin of BASEDIR/myGroup then CVSROOT/myGroup no longer serves any purpose?

Thanks,
Dan






Dan Weintraub | Systems Engineer
V: 877.327.8422 x
mailto:***@dealer.com | www.dealer.com
heasley
2016-02-08 23:17:29 UTC
Permalink
Post by Dan Weintraub
Post by heasley
I need to make that clearer; no attempt will be made to create repos if
CVSROOT looks like a URL. the script does not handle remote repos.
ie: if you want the origin (if i have the parlance correct) to be on a
remote host, you must create it yourself. My suggestion would be that you
let rancid-cvs create the repo locally, then move that to your remote host
and update group/.git/config to reflect that.
CVSROOT does not translate well to git; for rancid's purpose, it puts all
of it origins - one per group - under CVSROOT. so CVSROOT/myGroup,
CVSROOT/youGroup, CVSROOT/groupies etc. And, the working directory is
BASEDIR/myGroup.
So, if I change the origin of BASEDIR/myGroup then CVSROOT/myGroup no longer serves any purpose?
correct; if you move CVSROOT/myGroup to your central repo server, then its
"moved" and CVSROOT/myGroup is no longer needed.
Post by Dan Weintraub
Thanks,
Dan
Dan Weintraub | Systems Engineer
V: 877.327.8422 x
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Loading...