[j-nsp] "replace pattern" Command & White Spaces

Saku Ytti saku at ytti.fi
Sat Jul 30 04:13:19 EDT 2016


Hey,

I always just do:
start shell
zcat /config/juniper.conf.gz|sed 'magic' > new.conf
exit
configure exclusive
load override new.conf
commit and-quit


My main problem with 'replace' is, that it only considers 'user data',
it has no visibility on syntax, so you can't change ambiguous user
data, because you cannot add syntax to the match+replace.
Instead of trying to workaround with the implementation and what ever
corner cases I'm not yet aware of, I use generic tools I already know
how to use.

And obligatory configuration management note: I strongly believe only
correct way to deliver config to devices, is to deliver 100% from DB,
every time anything changes, and always only change is to replace all
of the config. This makes for very very simple provisioning system.
Unfortunately this configuration style excludes IOS, IOS-XE, TimOS and
many others, because they cannot replace whole config with new config,
which further means you'll need to add platform specific intelligence
in your configuration generation, which makes it expensive and hard to
generate config to such platforms.



On 30 July 2016 at 02:48, Mark Tinka <mark.tinka at seacom.mu> wrote:
> Hi all.
>
> We are trying to replace text in the configuration that contains spaces.
>
> Documentation suggests this can be done by surrounding the source text
> in quotes. But this does not work.
>
> JTAC have no answer, which is odd.
>
> Anyone know how to do this?
>
> A "| match" works with quotes enclosed, but "replace pattern" does not.
>
> All help appreciated.
>
> Mark.
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp



-- 
  ++ytti


More information about the juniper-nsp mailing list