mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
c371ed8d30
* Fix over-byte * Fix nxos_l2_interface docs * Update connections for tasks * Add default ssh port * Only report provider when using connection=local * Send empty provider when connection=network_cli * Fix find tasks
66 lines
1.3 KiB
YAML
66 lines
1.3 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_acl sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- set_fact: time_range="ans-range"
|
|
when: not ( platform is match("N5K"))
|
|
|
|
- name: "Setup: Cleanup possibly existing acl."
|
|
nxos_acl: &remove
|
|
name: TEST_ACL
|
|
seq: 10
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: "Configure ACL"
|
|
nxos_acl: &configure
|
|
name: TEST_ACL
|
|
seq: 10
|
|
action: permit
|
|
proto: tcp
|
|
src: 1.1.1.1/24
|
|
src_port_op: range
|
|
src_port1: 1900
|
|
src_port2: 1910
|
|
ack: 'enable'
|
|
dscp: 'af43'
|
|
dest: any
|
|
urg: 'enable'
|
|
psh: 'enable'
|
|
established: 'enable'
|
|
log: 'enable'
|
|
fin: 'enable'
|
|
rst: 'enable'
|
|
syn: 'enable'
|
|
time_range: "{{time_range|default(omit)}}"
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_acl: *configure
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: "Remove ACL"
|
|
nxos_acl: *remove
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Check Idempotence"
|
|
nxos_acl: *remove
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_acl sanity test"
|