fix nxos_nxapi test (#34972)

* Remove nxos_nxapi config test as config param is deprecated and removed

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxos_nxapi disable test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
pull/34973/head
Trishna Guha 7 years ago committed by GitHub
parent 8f80e6a302
commit 290b1651ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,87 +0,0 @@
- debug: msg="START cli/config.yaml"
#----
- name: Setup
nxos_config:
lines: no feature nxapi
match: none
provider: "{{ cli }}"
connection: local
- name: Get running-config
nxos_command:
commands: show running-config
provider: "{{ cli }}"
register: config
connection: local
- name: Set config
nxos_nxapi:
config: "{{ config.stdout[0] }}"
provider: "{{ cli }}"
register: config
connection: local
# Triggers the following changes:
# "updates": [
# "feature nxapi",
# "nxapi http port 80",
# "no nxapi https",
# "no nxapi sandbox"
# ],
- name: Ensure that this triggered a change
assert:
that:
- "config.changed == true"
#---
- name: Get running-config again
nxos_command:
commands: show running-config
provider: "{{ cli }}"
register: runningconfig
connection: local
- name: Set config
nxos_nxapi:
config: "{{ runningconfig.stdout[0] }}"
provider: "{{ cli }}"
register: config
connection: local
# BUG: The above shouldn't trigger the following updates
# Triggers the following changes:
# "updates": [
# "nxapi http port 80",
# "no nxapi https",
# "no nxapi sandbox"
# ],
# DEBUG: Try another time
- name: Set config - FIXME, shouldn't need this
nxos_nxapi:
config: "{{ runningconfig.stdout[0] }}"
provider: "{{ cli }}"
register: config
connection: local
# BUG: We are still getting changes
# Triggers the following changes:
# "updates": [
# "nxapi http port 80",
# "no nxapi https",
# "no nxapi sandbox"
# ],
- name: Idempotency check
assert:
that:
- "config.changed == false"
# FIXME: https://github.com/ansible/ansible-modules-core/issues/4955
ignore_errors: yes
- debug: msg="END cli/config.yaml"

@ -6,10 +6,6 @@
state: absent state: absent
provider: "{{ cli }}" provider: "{{ cli }}"
register: result register: result
# delegate_to: "{{ delegate_to }}"
- debug: var=result
when: debug
- name: Check NXAPI state - name: Check NXAPI state
nxos_command: nxos_command:
@ -17,10 +13,6 @@
- show feature | grep nxapi - show feature | grep nxapi
provider: "{{ cli }}" provider: "{{ cli }}"
register: result register: result
# delegate_to: "{{ delegate_to }}"
- debug: var=result
when: debug
- name: Assert NXAPI is disabled - name: Assert NXAPI is disabled
assert: assert:
@ -33,8 +25,6 @@
absent absent
provider: "{{ cli }}" provider: "{{ cli }}"
register: result register: result
# delegate_to: "{{ delegate_to }}"
- name: Assert idempotence - name: Assert idempotence
assert: assert:

Loading…
Cancel
Save