536dff507d
* nxos_vlan purge (#38202) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit119352b538
) * fix nxos_aaa_server issues (#38117) (cherry picked from commit697c301f04
) * fix nxos_aaa_server_host issues (#38188) (cherry picked from commit24cc6b80bd
) * fix nxos_static_route issues (#37614) * fix nxos_static_route issues * remove nxos_static_route from ignore (cherry picked from commit0df5cfd41f
) * fix nxos_acl issues (#38283) * fix nxos_acl issues * typo fix * typo fix in sanity.yaml * another typo fix in sanity.yaml (cherry picked from commit1bf29651af
) * nxos_acl_interface tests addition (#38230) (cherry picked from commitb8cb382a40
) * update changelog with nxos bugfixes for 2.5 Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * revert ignore.txt Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
130 lines
2.9 KiB
YAML
130 lines
2.9 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_acl_interface sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
# Select interface for test
|
|
- set_fact: intname="{{ nxos_int1 }}"
|
|
|
|
- name: "Interface selected for this test"
|
|
debug: msg="{{ intname }}"
|
|
|
|
- name: "Setup: Put interface into a default state"
|
|
nxos_config: &default
|
|
lines:
|
|
- "default interface {{ intname }}"
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: "Setup: Put interface into no switch port mode"
|
|
nxos_config:
|
|
commands:
|
|
- "no switchport"
|
|
parents:
|
|
- "interface {{ intname }}"
|
|
match: none
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: "Setup: Cleanup possibly existing acl"
|
|
nxos_acl: &remove
|
|
name: ANSIBLE_ACL
|
|
seq: 10
|
|
state: delete_acl
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: Configure Supporting ACL
|
|
nxos_acl:
|
|
name: ANSIBLE_ACL
|
|
seq: 10
|
|
action: permit
|
|
proto: tcp
|
|
src: 1.1.1.1/24
|
|
dest: any
|
|
provider: "{{ connection }}"
|
|
|
|
- block:
|
|
- name: Configure acl interface egress
|
|
nxos_acl_interface: &configure_egr
|
|
name: ANSIBLE_ACL
|
|
interface: "{{ intname }}"
|
|
direction: egress
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Check Idempotence egress"
|
|
nxos_acl_interface: *configure_egr
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: Configure acl interface ingress
|
|
nxos_acl_interface: &configure_ingr
|
|
name: ANSIBLE_ACL
|
|
interface: "{{ intname }}"
|
|
direction: ingress
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Check Idempotence ingress"
|
|
nxos_acl_interface: *configure_ingr
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: Cleanup acl interface egress
|
|
nxos_acl_interface: &cleanup_egr
|
|
name: ANSIBLE_ACL
|
|
interface: "{{ intname }}"
|
|
direction: egress
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Check Idempotence egress cleanup"
|
|
nxos_acl_interface: *cleanup_egr
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: Cleanup acl interface ingress
|
|
nxos_acl_interface: &cleanup_ingr
|
|
name: ANSIBLE_ACL
|
|
interface: "{{ intname }}"
|
|
direction: ingress
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Check Idempotence ingress cleanup"
|
|
nxos_acl_interface: *cleanup_ingr
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
rescue:
|
|
- name: Put test interface into default state.
|
|
nxos_config: *default
|
|
ignore_errors: yes
|
|
|
|
always:
|
|
- name: Remove possible configured ACL
|
|
nxos_acl: *remove
|
|
ignore_errors: yes
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_acl_interface sanity test"
|