2017-06-29 20:55:08 +02:00
|
|
|
---
|
2017-08-17 10:40:54 +02:00
|
|
|
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_acl sanity test"
|
2017-06-29 20:55:08 +02:00
|
|
|
|
2017-10-11 14:07:01 +02:00
|
|
|
- set_fact: time_range="ans-range"
|
2017-11-27 23:58:08 +01:00
|
|
|
when: not ( platform is match("N5K"))
|
2017-10-11 14:07:01 +02:00
|
|
|
|
2017-06-29 20:55:08 +02:00
|
|
|
- name: "Setup: Cleanup possibly existing acl."
|
|
|
|
nxos_acl: &remove
|
|
|
|
name: TEST_ACL
|
|
|
|
seq: 10
|
|
|
|
state: absent
|
2017-08-17 10:40:54 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-06-29 20:55:08 +02:00
|
|
|
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
|
2017-10-11 14:07:01 +02:00
|
|
|
src_port1: 1900
|
|
|
|
src_port2: 1910
|
2017-06-29 20:55:08 +02:00
|
|
|
ack: 'enable'
|
|
|
|
dscp: 'af43'
|
|
|
|
dest: any
|
|
|
|
urg: 'enable'
|
|
|
|
psh: 'enable'
|
|
|
|
established: 'enable'
|
|
|
|
log: 'enable'
|
|
|
|
fin: 'enable'
|
|
|
|
rst: 'enable'
|
|
|
|
syn: 'enable'
|
2017-10-11 14:07:01 +02:00
|
|
|
time_range: "{{time_range|default(omit)}}"
|
2017-06-29 20:55:08 +02:00
|
|
|
state: present
|
2017-08-17 10:40:54 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-06-29 20:55:08 +02:00
|
|
|
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
|
|
|
|
|
2017-08-17 10:40:54 +02:00
|
|
|
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_acl sanity test"
|