How to install RANCID on Fedora CoreOS
RANCID is an open-source tool that allows backup and management of configurations from network devices. In this tutorial, we will guide you on how to install RANCID on Fedora CoreOS.
Prerequisites
- A running instance of Fedora CoreOS latest.
- sudo or root access to the instance.
Installation
Open a terminal window on your Fedora CoreOS instance.
Install the required packages:
sudo dnf install git rancidCreate a directory for RANCID to store its configuration files:
sudo mkdir /etc/rancidCopy the rancid.conf.sample file to /etc/rancid/rancid.conf:
sudo cp /usr/share/doc/rancid/rancid.conf.sample /etc/rancid/rancid.confCreate a directory where RANCID will save the device configurations:
sudo mkdir /var/lib/rancidUpdate the rancid.conf file to specify the location of the directory created in Step 5:
sudo vi /etc/rancid/rancid.conf # Edit the following line: # RCSSYS=/usr/local/libexec/rancid # To: RCSSYS=/usr/libexec/rancid # Edit the following line: # LIST_OF_GROUPS="mygroup" # To: LIST_OF_GROUPS="mygroup" # Edit the following line: # LIST_OF_USERS = "" ; # Default user definitions # To: LIST_OF_USERS = "username" ; # Default user definitions # Edit the following line: # RANCID_BRANCH.master.regex = _{} # To: RANCID_BRANCH.master.regex = _.*{} # Add the following lines at the end of the file: cloginrc=/etc/rancid/.cloginrc logdir=/var/lib/rancid/logsCreate a cloginrc file in the /etc/rancid directory to specify the login credentials for each device:
sudo vi /etc/rancid/.cloginrc # Add the following lines for each device you want to backup: add user {DEVICE-IP-ADDRESS} {USERNAME} add password {DEVICE-IP-ADDRESS} {DEVICE-PASSWORD} add method {DEVICE-IP-ADDRESS} ssh # Replace {DEVICE-IP-ADDRESS}, {USERNAME} and {DEVICE-PASSWORD} with your device's IP address, username and password respectively.Modify the SELinux context of the log directory:
sudo semanage fcontext -a -t usr_t "/var/lib/rancid/logs(/.*)?" sudo restorecon -R /var/lib/rancid/logs/Start the RANCID services:
sudo systemctl start rancid-cvsweb sudo systemctl start rancid-cvsEnable RANCID to start on boot:
sudo systemctl enable rancid-cvsweb sudo systemctl enable rancid-cvs
Conclusion
You have successfully installed RANCID on your Fedora CoreOS instance. You can now use it to backup and manage configurations from network devices.