mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
nxos: merge nxapi/cli tests - interface, interface_ospf, logging, mtu (#28239)
* refactor nxos_interface * refactor nxos_interface_ospf * refactor nxos_logging * refactor nxos_mtu
This commit is contained in:
parent
c810a62db9
commit
2f7f23c9ab
20 changed files with 137 additions and 344 deletions
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
- debug: msg="START {{ connection.transport }}/set_state_absent.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
lines:
|
||||
- interface Loopback1
|
||||
provider: "{{ connection }}"
|
||||
|
||||
- name: set state=absent
|
||||
nxos_interface:
|
||||
interface: Loopback1
|
||||
state: absent
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
|
||||
- name: verify state=absent
|
||||
nxos_interface:
|
||||
interface: Loopback1
|
||||
state: absent
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- debug: msg="END {{ connection.transport }}/set_state_absent.yaml"
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
- debug: msg="START {{ connection.transport }}/set_state_present.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
lines:
|
||||
- no interface Loopback1
|
||||
provider: "{{ connection }}"
|
||||
ignore_errors: yes # Fails if the interface is already absent
|
||||
|
||||
- name: set state=present
|
||||
nxos_interface:
|
||||
interface: Loopback1
|
||||
state: present
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
|
||||
- name: verify state=present
|
||||
nxos_interface:
|
||||
interface: Loopback1
|
||||
state: present
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- debug: msg="END {{ connection.transport }}/set_state_present.yaml"
|
Loading…
Add table
Add a link
Reference in a new issue