Frontend Config in SVN

Have a scheme to track frontend config in SVN.

A directory structure is created at /var/svn, below here modified configurations are copied. This tree is then committed to subversion repo. A couple simple tools are provided to aid this process.

For example, on host msurxi, the file /var/svn/msurxi.aglt2.org/filesystem/etc/hosts corresponds to /etc/hosts.

The location in SVN for these is rocks/trunk/hostconfigs

One caveat is that we don't want to commit passwords (or hashed passwords) to SVN.

RW Access

Install ssh_key that has RW access to SVN

Setup

mkdir /var/svn
cd /var/svn
svn co $SVN_TRUNK/hostconfigs/msurxi.aglt2.org

Note that the msurxi.aglt2.org directory had previously been added to SVN. For new hosts, just do that. The above will then work. The above works when reinstalling the host in order to retrieve the saved config.

To see what config files differ:

/var/svn/msurxi.aglt2.org/tools/svn-filesystem-diff.sh

Manually update as appropriate.

Special case for SSH keys

The file /root/.ssh/authorized_keys is not directly in SVN, instead a file /root/.ssh/authorized_keys.admins is. The intent is to copy the second into the first to enable admin's ssh_keys.

Checkout the ROCKS Config

cd /export/rocks/install
export SVN_TRUNK=$SVN_ROCKS/trunk

svn checkout $SVN_TRUNK/config

[root@msurx install]# find contrib/
contrib/
contrib/5.2
contrib/5.2/x86_64
contrib/5.2/x86_64/SRPMS
contrib/5.2/x86_64/RPMS

rm -rf contrib
svn checkout $SVN_TRUNK/contrib

svn checkout $SVN_TRUNK/firmware

[root@msurx install]# find site-profiles/
site-profiles/
site-profiles/5.2
site-profiles/5.2/graphs
site-profiles/5.2/graphs/default
site-profiles/5.2/nodes
site-profiles/5.2/nodes/skeleton.xml

rm -rf site-profiles
svn checkout $SVN_TRUNK/site-profiles-X site-profiles

svn checkout $SVN_TRUNK/tools

Rebuild the Distribution

/export/rocks/install/tools/mkdist

Yum Update Frontend

Update the rpms on the frontend to pickup changes from rebuilt distro.

Note the removal of temporary yum files, may be needed to get rid of outdated repo data.

yum clean all
yum update

Reboot if a new kernel was installed...

-- TomRockwell - 11 Nov 2009
Topic revision: r8 - 09 Feb 2010, TomRockwell
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback