Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/bgp_neighbor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def log_neighbor_changes

def default_log_neighbor_changes
result = config_get_default('bgp_neighbor', 'log_neighbor_changes')
result.to_sym
result.to_sym unless result.nil?
end

def low_memory_exempt=(val)
Expand Down
12 changes: 6 additions & 6 deletions lib/cisco_node_utils/cmd_ref/README_YAML.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ for all products that do not match any of the given regexps:
```yaml
# show_version.yaml
system_image:
/N9K/:
/N9/:
config_get_token: "kick_file_name"
test_config_get_regex: '/.*NXOS image file is: (.*)$.*/'
else:
Expand All @@ -221,7 +221,7 @@ Related to product variants, an `_exclude` entry can be used to mark an entire f
```yaml
# fabricpath.yaml
---
_exclude: [/N3K/, /N9K/]
_exclude: [/N3/, /N9/]

_template:
...
Expand All @@ -232,7 +232,7 @@ Individual feature attributes can also be excluded in this way:
```yaml
attribute:
_exclude:
- /N7K/
- /N7/
default_value: true
config_get: 'show attribute'
config_set: 'attribute'
Expand Down Expand Up @@ -271,7 +271,7 @@ Using platform variants and product variants together:
description:
config_get_token: "chassis_id"
cli_nexus:
/N7K/:
/N7/:
test_config_get_regex: '/.*Hardware\n cisco (\w+ \w+ \(\w+ \w+\) \w+).*/'
else:
test_config_get_regex: '/Hardware\n cisco (([^(\n]+|\(\d+ Slot\))+\w+)/'
Expand Down Expand Up @@ -480,7 +480,7 @@ Some attributes may be hard-coded in such a way that they have a meaningful defa
negotiate_auto_ethernet:
kind: boolean
cli_nexus:
/(N7K|C3064)/:
/(N7|C3064)/:
# this feature is always off on these platforms and cannot be changed
default_only: false
else:
Expand Down Expand Up @@ -571,7 +571,7 @@ Should only be referenced by test scripts, never by a feature provider itself.
```yaml
# vtp.yaml
version:
/N7K/:
/N7/:
test_config_result:
3: 3
else:
Expand Down
4 changes: 2 additions & 2 deletions lib/cisco_node_utils/cmd_ref/bgp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ maxas_limit:
default_value: false

neighbor_down_fib_accelerate:
_exclude: [/N6K/, /N7K/]
_exclude: [/N6/, /N7/]
kind: boolean
config_get_token_append: '/^neighbor-down fib-accelerate$/'
config_set_append: '<state> neighbor-down fib-accelerate'
default_value: false

reconnect_interval:
_exclude: [/N6K/, /N7K/]
_exclude: [/N6/, /N7/]
kind: int
config_get_token_append: '/^reconnect-interval (\d+)$/'
config_set_append: '<state> reconnect-interval <seconds>'
Expand Down
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ local_as:
default_value: 0

log_neighbor_changes:
_exclude: [/N6K/, /N7K/]
_exclude: [/N(6|7)/]
multiple: true # not actually, but we get an array of matches
auto_default: false
config_get_token_append: '/^log-neighbor-changes\s+??(\S+)?\s+??$/'
Expand Down
10 changes: 5 additions & 5 deletions lib/cisco_node_utils/cmd_ref/interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ access_vlan:
admin_state_ethernet_noswitchport_shutdown:
# TODO: is this actually used?
cli_nexus:
/N7K/:
/N7/:
default_value: "shutdown"

all_interfaces:
Expand Down Expand Up @@ -124,7 +124,7 @@ negotiate_auto_ethernet:
'/^\s+no negotiate auto/',
'/^\s+negotiate auto/'
]
/(N7K|C3064)/:
/(N7|C3064)/:
default_only: false
else:
config_get_token_append: '/^(no )?negotiate auto$/'
Expand All @@ -142,7 +142,7 @@ negotiate_auto_portchannel:
'/^\s+no negotiate auto/',
'/^\s+negotiate auto/'
]
/N7K/:
/N7/:
default_only: false
else:
config_get_token_append: '/^(no )?negotiate auto$/'
Expand Down Expand Up @@ -259,14 +259,14 @@ system_default_switchport_shutdown:
# default_value: n/a. This is a user-configurable system default.

vlan_mapping:
_exclude: [/N(3|5|6|9)K/]
_exclude: [/N(3|5|6|9)/]
multiple:
config_get_token_append: '/^switchport vlan mapping (\d+) (\d+)/'
config_set_append: '%s switchport vlan mapping %s %s'
default_value: []

vlan_mapping_enable:
_exclude: [/N(3|5|6|9)K/]
_exclude: [/N(3|5|6|9)/]
kind: boolean
config_get_token_append: '/^(no )?switchport vlan mapping enable/'
config_set_append: '%s switchport vlan mapping enable'
Expand Down
4 changes: 2 additions & 2 deletions lib/cisco_node_utils/cmd_ref/interface_service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# interface_service
---
_template:
_exclude: [/N3/, /N5K/, /N6K/, /N9K/]
_exclude: [/N(3|5|6|9)/]
config_get: 'show running interface all'
config_get_token: '/^interface <name>$/i'
config_get_token_append:
Expand All @@ -23,7 +23,7 @@ encapsulation_profile_vni:
default_value: ''

shutdown:
/N7K/:
/N7/:
kind: boolean
config_get_token_append: '/^(?:no )?shutdown$/'
config_set_append: "<state> shutdown"
Expand Down
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/cmd_ref/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ chassis:

inventory:
# TODO: clean this up
/N7K/:
/N7/:
test_config_get_regex: [
'/.*\nNAME: "(.+)",\s+DESCR: "(.+)"\s+\nPID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/',
'/.*NAME: "(.+)",\s+DESCR: "(.+)"\s+PID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/'
Expand Down
4 changes: 2 additions & 2 deletions lib/cisco_node_utils/cmd_ref/show_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cpu:
description:
config_get_token: "chassis_id"
cli_nexus:
/N7K/:
/N7/:
test_config_get_regex: '/.*Hardware\n cisco (\w+ \w+ \(\w+ \w+\) \w+).*/'
else:
# Hardware
Expand Down Expand Up @@ -53,7 +53,7 @@ last_reset_time:

system_image:
cli_nexus:
/N7K/:
/N7/:
config_get_token: "isan_file_name"
test_config_get_regex: '/.*system image file is: (.*)$.*/'
else:
Expand Down
9 changes: 9 additions & 0 deletions lib/cisco_node_utils/cmd_ref/vdc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ limit_resource_module_type:
# check is meaningless and idempotence is not possible for 'default'.
config_get_token_append: '/^limit-resource module-type (.*)/'
config_set_append: '<state> limit-resource module-type <mods>'

vdc_support:
# This is a only used for determining support for VDCs
kind: boolean
/N7/:
default_only: true
else:
# this feature is always off on these platforms and cannot be changed
default_only: false
3 changes: 1 addition & 2 deletions lib/cisco_node_utils/cmd_ref/vlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ destroy:

mode:
_exclude:
- /N9K/
- /N3/
- /N(3|9)/
kind: string
config_get: "show vlan"
config_get_token: '/^%d+\s+enet\s+(\S+)\s/'
Expand Down
20 changes: 19 additions & 1 deletion lib/cisco_node_utils/cmd_ref/vni.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vni
---
_exclude: [/N5K/, /N6K/]
_exclude: [/N(5|6)/]
all_vnis:
multiple:
/N7/:
Expand Down Expand Up @@ -61,6 +61,24 @@ mapped_vlan:
config_set: ['vlan <vlan>', '<state> vn-segment <vni> ; end']
default_value: ''

mt_full_support:
# This is only used for determining support for Multi-Tenancy Full
kind: boolean
/N7/:
default_only: true
else:
# this feature is always off on these platforms and cannot be changed
default_only: false

mt_lite_support:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about 5k and 6k ? Are they mt full or lite?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You tell me :-)

I thought 5/6k were neither at the moment but getting support for mt full at some point?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked with my team, 5k/6k are mt-lite, so you may wanna add them under mt-lite here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My n56128P switch does not seem to support it:

n8k-136(config)# feature nv overlay
Error: feature nv overlay failed dependencies not satisfied yet

n8k-136(config)# feature vn-segment-vlan-based 
Error: vnseg_vlan control, vn-segment depends on feature-set fabricpath or feature nv overlay (0x411000bd)

If this is a license issue, how do I get around it? ie. how to check the current license; and how to fix it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the license guide:
http://www.cisco.com/c/en/us/td/docs/switches/datacenter/sw/nx-os/licensing/guide/b_Cisco_NX-OS_Licensing_Guide/b_Cisco_NX-OS_Licensing_Guide_chapter_01.html

For now though, I suggest to add a story to backlog for adding mt-lite puppet support for 5/6k. We can look at it when we test 5/6k

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# This is only used for determining support for Multi-Tenancy Lite
kind: boolean
/N(3|9)/:
default_only: true
else:
# this feature is always off on these platforms and cannot be changed
default_only: false

shutdown:
# MT-Full only
/N7/:
Expand Down
41 changes: 16 additions & 25 deletions lib/cisco_node_utils/cmd_ref/vrf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,14 @@ destroy:
config_set: "no vrf context <vrf>"

feature_vn_segment_vlan_based:
_exclude:
- [/N7K/] # Support for multi-tenancy full only
kind: boolean
default_value: false
cli_nexus:
config_get: 'show running section feature'
config_get_token: '/^feature vn-segment-vlan-based$/'
config_set: 'feature vn-segment-vlan-based'

feature_vni:
_exclude: [/N3K/, /N9K/] # Support for multi-tenancy lite only
kind: boolean
default_value: false
cli_nexus:
config_get: 'show running section feature'
config_get_token: '/^feature vni$/'
config_set: 'feature vni'
# MT-lite only
/N(3|9)/:
kind: boolean
default_value: false
cli_nexus:
config_get: 'show running section feature'
config_get_token: '/^feature vn-segment-vlan-based$/'
config_set: 'feature vn-segment-vlan-based'

shutdown:
kind: boolean
Expand All @@ -43,13 +34,13 @@ shutdown:
config_set: ["vrf context <vrf>", "<state> shutdown"]
default_value: false

vni:
_exclude:
- [/N3/] # N3: Support Unknown
kind: int
config_get: "show running | section 'vrf context'"
config_get_token: ['/^vrf context <vrf>$/i', '/^vni (\d+)$/']
config_set: ["vrf context <vrf>", "<state> vni <id>"]
default_value: false
vni: # TBD Should this move to the vni provider as vrf_vni?
# MT-lite only
/N9/:
kind: int
config_get: "show running | section 'vrf context'"
config_get_token: ['/^vrf context <vrf>$/i', '/^vni (\d+)$/']
config_set: ["vrf context <vrf>", "<state> vni <id>"]
default_value: false


2 changes: 1 addition & 1 deletion lib/cisco_node_utils/cmd_ref/vtp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ version:
config_get_token: '/VTP\s+version\s+running\s+:\s+(\d+)/'
config_set: "vtp version %s"
default_value: 1
/N7K/:
/N7/:
test_config_result:
3: 3
else:
Expand Down
3 changes: 1 addition & 2 deletions lib/cisco_node_utils/cmd_ref/vxlan.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# vxlan
---
_exclude: [/N(3|5|6|9)/]
_exclude: [/N(5|6)/]

feature_nv_overlay:
# This is a multi-use feature, thus enable-only
kind: boolean
config_get: 'show running nv overlay'
config_get_token: '/^feature nv overlay$/'
Expand Down
25 changes: 22 additions & 3 deletions lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,28 @@ all_interfaces:
config_get_token: '/^interface (.*)$/'

host_reachability:
config_get_token_append: '/^host-reachability protocol (\S+)/'
config_set_append: '<state> host-reachability protocol <proto>'
default_value: 'flood'
/N(7|9)/:
config_get_token_append: '/^host-reachability protocol (\S+)/'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is host-reachability not available in 3k/5k/6k?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not available on my n3k. Again I'll need your input for 5/6k support expectations.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks okay for now. We can tweak it when we test throughly for 5/6k

config_set_append: '<state> host-reachability protocol <proto>'
default_value: 'flood'

mt_full_support:
# This is only used for determining support for Multi-Tenancy Full
kind: boolean
/N(7)/:
default_only: true
else:
# this feature is always off on these platforms and cannot be changed
default_only: false

mt_lite_support:
# This is only used for determining support for Multi-Tenancy Lite
kind: boolean
/N(3|9)/:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add 5k, 6k under mt-lite

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defer to US 62787.

default_only: true
else:
# this feature is always off on these platforms and cannot be changed
default_only: false

shutdown:
kind: boolean
Expand Down
3 changes: 2 additions & 1 deletion lib/cisco_node_utils/interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
require_relative 'node_util'
require_relative 'pim'
require_relative 'vrf'
require_relative 'vni'

# Add some interface-specific constants to the Cisco namespace
module Cisco
Expand Down Expand Up @@ -567,7 +568,7 @@ def vlan_mapping
end

def vlan_mapping=(should_list)
Vrf.feature_vni_enable unless Vrf.feature_vni_enabled
Vni.feature_vni_enable unless Vni.feature_vni_enabled

# Process a hash of vlan_mapping cmds from delta_add_remove().
# The vlan_mapping cli does not allow commands to be updated, they must
Expand Down
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/interface_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def encapsulation_profile_vni
end

def encapsulation_profile_vni=(profile)
Vrf.feature_vni_enable unless Vrf.feature_vni_enabled
Vni.feature_vni_enable unless Vni.feature_vni_enabled
state = profile.empty? ? 'no' : ''
current = encapsulation_profile_vni

Expand Down
4 changes: 4 additions & 0 deletions lib/cisco_node_utils/vdc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def self.vdcs
hash
end

def self.vdc_support
config_get('vdc', 'vdc_support')
end

def self.default_vdc_name
vdc = config_get('vdc', 'default_vdc_name')
fail RuntimeError if vdc.nil?
Expand Down
Loading