Rancid – Installation

Installation script – this script is not quite finish yet, but it works. you will need to edit list of groups, there are some lines that needs to be edited before running this script, such as ip addresses, passwords, and groups

this script will be updated soon to promt for these changes


apt install subversion telnet mutt rancid viewvc perl python cvs

echo 192.168.4.13 switch1 >> /etc/hosts

sed -i 's/#LIST_OF_GROUPS="$.*/LIST_OF_GROUPS="test"/' /etc/rancid/rancid.conf
sed -i 's/CVSROOT=$.*/CVSROOT=$BASEDIR\/svn; export CVSROOT/' /etc/rancid/rancid.conf
sed -i 's/^RCSSYS.*/RCSSYS=svn; export RCSSYS'/ /etc/rancid/rancid.conf

su - rancid

cat <<EOF> /var/lib/rancid/.cloginrc
add method switch1 {ssh}
add cyphertype switch1 {aes128-ctr,3des-cbc}
add user switch1 root
add password switch1 userpass enablepass
EOF

chmod 600 /var/lib/rancid/.cloginrc


/usr/lib/rancid/bin/rancid-cvs

echo "switch1;cisco;up" > /var/lib/rancid/test/router.db

rancid-run
rancid-run

exit

sed -i 's/^#svn_roots.*/svn_roots = rancid: \/var\/lib\/rancid\/svn/' /etc/viewvc/viewvc.conf
usermod -a -G rancid www-data


cat <<EOF> /etc/apache2/conf-available/viewvc.conf
Alias       /viewvc-static /etc/viewvc/templates/docroot
ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi
EOF

a2enconf viewvc.conf
a2enmod cgi
systemctl restart apache2


Leave a Reply

Your email address will not be published. Required fields are marked *