|
|
|
@ -1,13 +1,20 @@
|
|
|
|
|
---
|
|
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_gir sanity test"
|
|
|
|
|
- set_fact: gir_run='{{ true if (platform is not search("N35")) else false }}'
|
|
|
|
|
|
|
|
|
|
- name: Setup0
|
|
|
|
|
nxos_config: &cleanup0
|
|
|
|
|
lines:
|
|
|
|
|
- no system mode maintenance timeout 30
|
|
|
|
|
- no configure maintenance profile normal-mode
|
|
|
|
|
- no configure maintenance profile maintenance-mode
|
|
|
|
|
match: none
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
- set_fact: gir_run="true"
|
|
|
|
|
- set_fact: gir_run="false"
|
|
|
|
|
when: platform is search("N35")
|
|
|
|
|
#- name: "Setup"
|
|
|
|
|
# nxos_gir: &setup
|
|
|
|
|
# system_mode_maintenance: false
|
|
|
|
|
# ignore_errors: yes
|
|
|
|
|
- name: Setup1
|
|
|
|
|
nxos_gir:
|
|
|
|
|
system_mode_maintenance: false
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
- name: "Put system in maintenance mode with reload reset reason"
|
|
|
|
@ -68,12 +75,12 @@
|
|
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
|
|
# - name: "Put system in maintenance mode"
|
|
|
|
|
# nxos_gir: &configure_system_mode_maintenance
|
|
|
|
|
# system_mode_maintenance: true
|
|
|
|
|
# register: result
|
|
|
|
|
#
|
|
|
|
|
# - assert: *true
|
|
|
|
|
- name: "Put system in maintenance mode"
|
|
|
|
|
nxos_gir: &configure_system_mode_maintenance
|
|
|
|
|
system_mode_maintenance: true
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
|
|
when: gir_run
|
|
|
|
|
|
|
|
|
@ -88,21 +95,18 @@
|
|
|
|
|
action: delete_all
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
- name: "Remove other config1"
|
|
|
|
|
nxos_config:
|
|
|
|
|
lines: no configure maintenance profile normal-mode
|
|
|
|
|
match: none
|
|
|
|
|
- name: Teardown0
|
|
|
|
|
nxos_config: *cleanup0
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
- name: "Remove other config2"
|
|
|
|
|
nxos_config:
|
|
|
|
|
lines: no configure maintenance profile maintenance-mode
|
|
|
|
|
match: none
|
|
|
|
|
- name: "Put system back in normal mode"
|
|
|
|
|
nxos_gir:
|
|
|
|
|
system_mode_maintenance: false
|
|
|
|
|
# Try again if cli is blocking while changing modes
|
|
|
|
|
retries: 3
|
|
|
|
|
delay: 30
|
|
|
|
|
register: result
|
|
|
|
|
until: result is not failed
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
# - name: "Put system back in normal mode"
|
|
|
|
|
# nxos_gir: *setup
|
|
|
|
|
# register: result
|
|
|
|
|
# ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_gir sanity test"
|
|
|
|
|