Installation
You can see all the steps on the video
The installation process is simple. You can use VM for this purpose.
Here is a step-by-step instruction for Ubuntu.
$PSEFABRIC
and $CONFD_DIR
are environment variables representing any path where you want to install PSEFABRIC and CONFD (http://www.tail-f.com).
For example, it might be something like that
export PSEFABRIC='/opt/QA'
export CONFD_DIR='/opt/QA/CONFD'
"Any variables added to these locations will not be reflected when invoking them with a sudo command, as sudo has a default policy of resetting the Environment and setting a secure path (this behavior is defined in /etc/sudoers). As a workaround, you can use sudo su that will provide a shell with root privileges but retaining any modified PATH variables. Alternatively, you can setup sudo not to reset certain environment variables by adding some explicit environment settings to keep in /etc/sudoers" link
So for Ubuntu:
sudo visudo
insert Defaults env_keep += "PSEFABRIC CONFD_DIR"
Clone git repository to $PSEFABRIC
.
sudo mkdir $PSEFABRIC
cd $PSEFABRIC
sudo git clone https://github.com/nihole/PSEFABRIC.git
If ConfD (http://www.tail-f.com) has not been installed then you have to fulfill the next steps.
sudo mkdir $CONFD_DIR
Now we need to install ConfD Basic (http://www.tail-f.com)
Download ConfD Basic from the page http://www.tail-f.com/confd-basic/ (in our examples we will use confd-basic-6.6.linux.x86_64 version)
cd confd-basic-6.6.linux.x86_64/
sudo sh confd-basic-6.6.linux.x86_64.installer.bin $CONFD_DIR
cd $CONFD_DIR
With the default ConfD configuration confd.conf, the default value will not show. We want to change this behavior in the confd.conf ConfD configuration.
For this purpose in confd.conf we have to add this line
<defaultHandlingMode>report-all</defaultHandlingMode>
Create folders for Configuration Managent Engine. The names of course may be different.
sudo mkdir $CONFD_DIR/myprojects
sudo mkdir $CONFD_DIR/myprojects/psefabric
sudo cp -r $PSEFABRIC/PSEFABRIC/CONFD/* $CONFD_DIR/myprojects/psefabric/
sudo cp $PSEFABRIC/PSEFABRIC/PSEF_YANG/* $CONFD_DIR/myprojects/psefabric/
PSEFABRIC scripts use the CONFD_DIR and PSEFABIRC variables. To switch between projects additional variable PROJECT is also used.
To copy environment variables to /etc/profile.d/ and install new CONFD interface (YANG)
- go in folder $PSEFABRIC
cd $PSEFABRIC
- edit file env for example
vi env
- correct the paths in accordance with your implementation, for example
export PSEFABRIC=/opt/QA/PSEFABRIC
export PROJECT=$PSEFABRIC/PSEFABRIC/PROJECTS/p000
export CONFD_DIR=/opt/QA/CONFD
- exit the editor and execute script psef_conf.sh
sh psef_conf.sh
Now every time when you create a new terminal session the variables PSEFABRIC, PROJECT, CONFD_DIR will be downloaded to the shell.
Maybe you also need to install some modules.
- install nesassary python modules:
*
sudo pip install xmltodict
sudo pip install deepdiff
sudo pip install ncclient
- install nesassary perl modules:
sudo cpan Net::Netconf::Manager
sudo cpan Net::Telnet::Cisco
sudo cpan Net::SSH2
Maybe some additional modules are also needed. For example for Ubuntu 18.04 I also had to install:
sudo apt-get install libnet-ssh2-perl
sudo apt-get install zlib
sudo apt-get install zlib1g-dev libxml2-dev
Now to start the PSEFABRIC you need to start CONFD.
cd $CONFD_DIR/myprojects/psefabric
sudo make all start
Now you may configure PSEFABRIC.