[rancid] Upgrades with new commands and custom PM files.
Jason Biel
jason at biel-tech.com
Tue Feb 21 19:33:37 UTC 2017
Is copying the whole *.pm the best way though? All the default
commands/routines included.
i.e. junos.pm --> junos_rtr.pm; which then gets configured in
rancid.types.conf
I add the custom commands/routines to 'junos_rtr.pm', but included all the
original commands/routines. Then when an upgrade comes up and there is a
fix to the original junos.pm, it's not in the junos_rtr.pm I created.
Thinking out loud, is there a way to have a junos_rtr.pm that includes only
my custom commands/routines and leave the original junos.pm intact?
I want rancid to also run "show system commit":
i.e. rancid.types.base has:
juniper;script;rancid -t juniper
juniper;login;jlogin
juniper;module;junos
juniper;inloop;junos::inloop
juniper;command;junos::ShowChassisClocks;show chassis clocks
<omitted base commands>
juniper;command;junos::ShowConfiguration;show configuration
and rancid.types.conf has:
junos_rtr;script;rancid -t junos_rtr
junos_rtr;login;jlogin
junos_rtr;module;junos_rtr
junos_rtr;inloop;junos_rtr::inloop
junos_rtr;command;junos_rtr::ShowSystemCommit;show system commit
with the junos_rtr.pm containing only the minimal configuration needed for
the routine to process ShowSystemCommit.
Having custom commands/routines separated seems like it would be easier to
deal with upgrades so that fixes in the provided *.pm files got applied,
without having to diff the new base *.pm files against the custom ones.
On Tue, Feb 21, 2017 at 12:43 PM, Erik Muller <erikm at buh.org> wrote:
> On 2/21/17 13:09 , Jason Biel wrote:
> > When adding new commands via creating rancid.types.conf and creating a
> new
> > *.pm file, what is the best process with regards to upgrading?
> >
> > I've been running 3.2 with a specific rancid.types.conf file that
> > referenced specific *.pm files, but after upgrading to 3.6.2, none of
> them
> > worked because the *.pm files are specifically hard coded to the rancid
> > version. To create my specific *.pm files I just copied the current *.pm
> > file from the 3.2 install and made my modifications there, such as the
> > commands and the sub-routine.
> >
> > 3.2 - 'use rancid 3.2'
> > 3.6.2 - 'use rancid 3.6.2'
> >
> > Is there a better way?
>
> You should just be able to just leave off the version tag (ie, just "use
> rancid;"), to use the current default version.
> You should only need to specify the version if you want to make sure it's
> consistent with the rest of a package, or need to ensure that some minimum
> version is present because you need features in that version or later.
> (3.6.2 is obviously > 3.2, so actually that should work - I think the check
> breaks because the version numbers have different formats, where one looks
> like a number and the other a string?.)
>
> hth,
> -e
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
>
--
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20170221/d0d761a4/attachment.html>
More information about the Rancid-discuss
mailing list