cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
115
Views
0
Helpful
1
Replies

Using device templates to standardize configurations

kjdhghsghsfg
Level 1
Level 1

Hi

I'm running NSO 6.1.7.1 with juniper-junos-nc-4.12 NED.
I'm trying to use NSO device templates to standardize certain parts of device configurations.
In this particular case I'm trying to force a certain set of "apply-groups" on a given Junos configuration level. For example: I want the Junos devices to be configured like this:

protocols {                             
    ospf {                              
        apply-groups [ GROUP1 GROUP2 GROUP3 ];
    }
}

It's easy to use device templates to add apply-groups. But I haven't found a way to delete them. For example if Junos device already has following config:

protocols {                             
    ospf {                              
        apply-groups [ GROUP1 GROUP2 GROUP3 GROUP4 ];
    }
}

I haven't been able to figure out the way to delete GROUP4.
More specifically I would like to find a way to force the set of groups instead of configuring template to delete GROUP4, because on some other device there might be, for example, GROUP5. And I don't want to check all of them manually...

For example I have tried to use the replace tag:

[edit devices template TEST2 ned-id juniper-junos-nc-4.12 config configuration protocols ospf]
user@nso-server% annotate ?
Description: OSPF configuration
Possible completions:
  apply-groups         
  apply-macro          
  area                 Configure an OSPF area
  backup-spf-options   Configure options for backup SPF
  domain-id            Configure domain ID
  graceful-restart     Configure graceful restart attributes
  spf-options          Configure options for SPF
  topology             Topology parameters
  traceoptions         Trace options for OSPF
  undocumented         
user@nso-server% annotate apply-groups ?
Possible completions:
  string  [
user@nso-server% annotate apply-groups "Tags: replace"
Error: the operation is not supported on 'devices template TEST2 ned-id juniper-junos-nc-4.12 config configuration protocols ospf apply-groups'

And equivalent in Cisco cli where the result is no error but the "! Tags: replace" does not appear in the template config.

I have succesfully used the "Tags: replace" in multiple other configuration stanzas.


Please advice
Or should I create a tac case and request enhancement?
Or am I trying to do something totally unsupported?

https://developer.cisco.com/docs/nso/guides/compliance-reporting/

1 Reply 1

huayyang
Cisco Employee
Cisco Employee