[svk-users] svk and administration
Glen Ogilvie
nelg at linuxsolutions.co.nz
Tue Sep 4 16:30:16 EDT 2007
Hi,
On Tue, 4 Sep 2007 13:09:34 -0700, "Pierce T. Wetter III"
<pierce at twinforces.com> wrote:
>
> Ok, so I read this:
>
> http://lists.debian.org/debian-devel/2005/02/msg00495.html
>
>
> Which is pretty cool and all. I want to store my system config
> files in version control, but I don't want to store everything in /
> etc, and I didn't want to have to have the .svn file around. I was
> thinking I was going to have to write some sort of script to use
> rsync and clone files out of /etc into a separate directory, and back
> again that would all sit on top of svn.
>
> So this svk solution sounds cool. Importing all of /etc seems like
> overkill, I'm wondering if some svk expert could give me some tips on
> how to solve this problem more efficiently.
>
> My dream solution: (mds)
>
> 1. Would take a file/directory on an arbitrary path and let me
> add it to version control.
>
> mds add /etc/httpd/
> mds add /etc/hostconfig
>
> 2. Would then be able to diff/commit as needed:
>
> mds commit (commits all config files changes)
> mds update (grabs updates)
>
> 3. Would be able to deal with per-machine variations...
>
> mds add /etc/httpd/ipconfig
>
> Some of my thoughts (not well developed because I know little
> about svk).
>
> Seems like for most configs, I could have a master set,
> effectively "trunk".
>
> For machines that have slight tweaks (lets say the gateway and
> the dns server is the same for all machines, but each one has a
> different ip address). So the trunk config file would look like this:
>
> address=192.168.1.2
> dns= 16.17.18.19.20
> gateway=192.168.1.1
>
> Then each machine specific file could get stored on a branch by
> hostname, and would have a change like the following:
> <
> address=192.168.1.2
> -------
> address=192.168.1.3
> >
>
> So questions:
>
> 1. Is anyone doing anything like this? What do you think the
> gotchas would be? How would you set this up?
Yes, I've been managing my etc directory like this. I also did not see the
point in adding in files that I've never changed.
>
> 2. The example above grabs everything in /etc, then removes the
> stuff you don't want. Is there an easy way to grab only the things
> you DO want?
Yes, inport the etc directory with the non-recursive flag (-N) and also use
the inplace (-t) option. That will just add the etc directory without any
files to the svk repository, then just add the files and directories you
want using svk add with the -N flag. You can also use propset to ignore
files you don't want to show up when you do an svk status.
Here are a couple of links about it:
http://www.enricozini.org/2005/tips/etc-under-svk.html
http://repo.utsl.gen.nz/talks/svk/slide8e.html
Note, these links assume your doing the whole directory, so I suggest you
play a little before just trying their examples.
I think, from memory, If say, you just wanted /etc/httpd/ipconfig , then
something like
- Create the repository
svk depot config /var/lib/config-svk
svk import -m 'Initial import' -N --to-checkout /config/ /etc
- add /etc/httpd/ipconfig
cd /etc
svk add -N httpd
svk add -N httpd/ipconfig
svk commit -m 'added hosts file'
Cheers
Glen
More information about the svk-users
mailing list