@ -1,4 +1,5 @@
---
---
- block:
- name : Enable Feature Privilege
- name : Enable Feature Privilege
nxos_config:
nxos_config:
lines:
lines:
@ -23,7 +24,8 @@
#
#
# Usage in integration test playbook:
# Usage in integration test playbook:
#
#
# - set_fact: testint="{{ nxos_int1 }}"
# - set_fact:
# testint: "{{ nxos_int1 }}"
#
#
# - name: "Interface selected for this test"
# - name: "Interface selected for this test"
# debug: msg="{{ testint }}"
# debug: msg="{{ testint }}"
@ -34,10 +36,17 @@
connection : network_cli
connection : network_cli
register : intout
register : intout
- set_fact : intdataraw="{{ intout.stdout_lines[0]['TABLE_interface']['ROW_interface'] }}"
- set_fact:
- set_fact : nxos_int1="{{ intdataraw[1].interface }}"
intdataraw : "{{ intout.stdout_lines[0]['TABLE_interface']['ROW_interface'] }}"
- set_fact : nxos_int2="{{ intdataraw[2].interface }}"
- set_fact : nxos_int3="{{ intdataraw[3].interface }}"
- set_fact:
nxos_int1 : "{{ intdataraw[1].interface }}"
- set_fact:
nxos_int2 : "{{ intdataraw[2].interface }}"
- set_fact:
nxos_int3 : "{{ intdataraw[3].interface }}"
# Get image version information for this device
# Get image version information for this device
- name : "Gather image version info"
- name : "Gather image version info"
@ -46,7 +55,8 @@
connection : network_cli
connection : network_cli
register : nxos_version_output
register : nxos_version_output
- set_fact : image_version="{{ nxos_version_output.stdout[0]['kickstart_ver_str'] }}"
- set_fact:
image_version : "{{ nxos_version_output.stdout[0]['kickstart_ver_str'] }}"
# Get platform information for this device
# Get platform information for this device
#
#
@ -61,67 +71,104 @@
connection : network_cli
connection : network_cli
register : nxos_inventory_output
register : nxos_inventory_output
- set_fact : platform="{{ nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'][0]['productid'].split('-')[0] }}"
- set_fact:
- set_fact : chassis_type="{{ nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'][0]['productid'].split('-')[1] }}"
platform : "{{ nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'][0]['productid'].split('-')[0] }}"
- set_fact:
chassis_type : "{{ nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'][0]['productid'].split('-')[1] }}"
# Check if platform is fretta
# Check if platform is fretta
- set_fact : fretta={% for row in nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'] if '-R' in row['productid'] %}"true"{% endfor %}
- set_fact:
fretta : "{% for row in nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'] if '-R' in row['productid'] %}true{% endfor %}"
when : platform is match("N9K|N3K")
when : platform is match("N9K|N3K")
# Set platform to N3K-F for fretta
# Set platform to N3K-F for fretta
- set_fact : platform="N3K-F"
- set_fact:
platform : "N3K-F"
when : ( platform is match("N3K")) and ( fretta is search("true"))
when : ( platform is match("N3K")) and ( fretta is search("true"))
# Set platform to N9K-F for fretta
# Set platform to N9K-F for fretta
- set_fact : platform="N9K-F"
- set_fact:
platform : "N9K-F"
when : ( platform is match("N9K")) and ( fretta is search("true"))
when : ( platform is match("N9K")) and ( fretta is search("true"))
# Check if platform is titanium
# Check if platform is titanium
- set_fact : titanium="false"
- set_fact:
- set_fact : titanium={% for row in nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'] if 'NX-OSv' in row['desc']%}"true"{% endfor %}
titanium : "false"
- set_fact:
titanium : "{% for row in nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'] if 'NX-OSv' in row['desc']%}true{% endfor %}"
when : platform is match("N7K")
when : platform is match("N7K")
# Set platform to N35 for N3k-35xx
# Set platform to N35 for N3k-35xx
- set_fact : platform="N35"
- set_fact:
platform : "N35"
when : ( chassis_type is search("C35"))
when : ( chassis_type is search("C35"))
# Set platform to N35NG for N3k-35xx running image version
# Set platform to N35NG for N3k-35xx running image version
# 7.0(3)I7 or later. NG(Next Gen)
# 7.0(3)I7 or later. NG(Next Gen)
- set_fact : platform="N35NG"
- set_fact:
platform : "N35NG"
when : ( chassis_type is search("C35")) and image_version is search("7.0\(3\)I7")
when : ( chassis_type is search("C35")) and image_version is search("7.0\(3\)I7")
# Set platform to N3L(N3K Legacy) for C3048 platform.
# Set platform to N3L(N3K Legacy) for C3048 platform.
- set_fact : platform="N3L"
- set_fact:
platform : "N3L"
when : ( chassis_type is search("C3048"))
when : ( chassis_type is search("C3048"))
# Create matrix of simple keys based on platform
# Create matrix of simple keys based on platform
# and image version for use within test playbooks.
# and image version for use within test playbooks.
- set_fact : imagetag=""
- set_fact:
- set_fact : imagemr=""
imagetag : ""
- set_fact:
imagemr : ""
# Examples
# Examples
# 8.0(1)
# 8.0(1)
# 7.3(0)D1(1)
# 7.3(0)D1(1)
# 7.0(3)IHD8(1)
# 7.0(3)IHD8(1)
- set_fact : major_version="{{ image_version[0:3] }}"
- set_fact:
- set_fact : imagetag="{{ image_version[0:3] }}"
major_version : "{{ image_version[0:3] }}"
- set_fact:
imagetag : "{{ image_version[0:3] }}"
when : image_version is search("\d\.\d\(\d\)")
when : image_version is search("\d\.\d\(\d\)")
- set_fact : imagetag="{{ image_version[6:8] }}"
- set_fact:
imagetag : "{{ image_version[6:8] }}"
when : image_version is search("\d\.\d\(\d\)\S\S\(\d\)")
when : image_version is search("\d\.\d\(\d\)\S\S\(\d\)")
- set_fact : imagetag="{{ image_version[6:10] }}"
- set_fact:
imagetag : "{{ image_version[6:10] }}"
when : image_version is search("\d\.\d\(\d\)\S\S\S\S\(\d\)")
when : image_version is search("\d\.\d\(\d\)\S\S\S\S\(\d\)")
- set_fact : imagemr="{{ image_version[4:5] }}"
- set_fact:
imagemr : "{{ image_version[4:5] }}"
when : image_version is search("\d\.\d\(\d\)")
when : image_version is search("\d\.\d\(\d\)")
- set_fact : imagemr="{{ image_version[9:10] }}"
- set_fact:
imagemr : "{{ image_version[9:10] }}"
when : image_version is search("\d\.\d\(\d\)\S\S\(\d\)")
when : image_version is search("\d\.\d\(\d\)\S\S\(\d\)")
- set_fact : imagemr="{{ image_version[11:12] }}"
- set_fact:
imagemr : "{{ image_version[11:12] }}"
when : image_version is search("\d\.\d\(\d\)\S\S\S\S\(\d\)")
when : image_version is search("\d\.\d\(\d\)\S\S\S\S\(\d\)")
- debug : msg="IMAGE VERSION {{ image_version }}"
- debug:
- debug : msg="IMAGE TAG {{ imagetag }}"
msg : "IMAGE VERSION {{ image_version }}"
- debug : msg="IMAGE MR {{ imagemr }}"
- debug:
msg : "IMAGE TAG {{ imagetag }}"
- set_fact : ipv6_supported="true"
- debug:
- set_fact : ipv6_supported="false"
msg : "IMAGE MR {{ imagemr }}"
- set_fact:
ipv6_supported : "true"
- set_fact:
ipv6_supported : "false"
when : platform is match("N35")
when : platform is match("N35")
when : prepare_nxos_tests_task | default(True) | bool