|
|
@ -4,37 +4,37 @@
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
---
|
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- block:
|
|
|
|
- name: Test an API key is provided
|
|
|
|
# - name: Test an API key is provided
|
|
|
|
fail:
|
|
|
|
# fail:
|
|
|
|
msg: Please define an API key
|
|
|
|
# msg: Please define an API key
|
|
|
|
when: auth_key is not defined
|
|
|
|
# when: auth_key is not defined
|
|
|
|
|
|
|
|
|
|
|
|
- name: Use an invalid domain
|
|
|
|
# - name: Use an invalid domain
|
|
|
|
meraki_organization:
|
|
|
|
# meraki_organization:
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
# auth_key: '{{ auth_key }}'
|
|
|
|
host: marrrraki.com
|
|
|
|
# host: marrrraki.com
|
|
|
|
state: present
|
|
|
|
# state: present
|
|
|
|
org_name: IntTestOrg
|
|
|
|
# org_name: IntTestOrg
|
|
|
|
output_level: debug
|
|
|
|
# output_level: debug
|
|
|
|
delegate_to: localhost
|
|
|
|
# delegate_to: localhost
|
|
|
|
register: invalid_domain
|
|
|
|
# register: invalid_domain
|
|
|
|
ignore_errors: yes
|
|
|
|
# ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
|
|
- name: Disable HTTP
|
|
|
|
# - name: Disable HTTP
|
|
|
|
meraki_organization:
|
|
|
|
# meraki_organization:
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
# auth_key: '{{ auth_key }}'
|
|
|
|
use_https: false
|
|
|
|
# use_https: false
|
|
|
|
state: query
|
|
|
|
# state: query
|
|
|
|
output_level: debug
|
|
|
|
# output_level: debug
|
|
|
|
delegate_to: localhost
|
|
|
|
# delegate_to: localhost
|
|
|
|
register: http
|
|
|
|
# register: http
|
|
|
|
ignore_errors: yes
|
|
|
|
# ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
|
|
- name: Connection assertions
|
|
|
|
# - name: Connection assertions
|
|
|
|
assert:
|
|
|
|
# assert:
|
|
|
|
that:
|
|
|
|
# that:
|
|
|
|
- '"Failed to connect to" in invalid_domain.msg'
|
|
|
|
# - '"Failed to connect to" in invalid_domain.msg'
|
|
|
|
- '"http" in http.url'
|
|
|
|
# - '"http" in http.url'
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create network
|
|
|
|
- name: Create network
|
|
|
|
meraki_network:
|
|
|
|
meraki_network:
|
|
|
@ -146,6 +146,45 @@
|
|
|
|
- assert:
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- query.data.1.syslogEnabled == True
|
|
|
|
- query.data.1.syslogEnabled == True
|
|
|
|
|
|
|
|
- default_syslog.changed == True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Disable syslog for default rule
|
|
|
|
|
|
|
|
meraki_mx_l3_firewall:
|
|
|
|
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
|
|
|
|
org_name: '{{test_org_name}}'
|
|
|
|
|
|
|
|
net_name: TestNetAppliance
|
|
|
|
|
|
|
|
state: present
|
|
|
|
|
|
|
|
rules:
|
|
|
|
|
|
|
|
- comment: Deny to documentation address
|
|
|
|
|
|
|
|
src_port: any
|
|
|
|
|
|
|
|
src_cidr: any
|
|
|
|
|
|
|
|
dest_port: 80,443
|
|
|
|
|
|
|
|
dest_cidr: 192.0.1.1/32
|
|
|
|
|
|
|
|
protocol: tcp
|
|
|
|
|
|
|
|
policy: deny
|
|
|
|
|
|
|
|
syslog_default_rule: no
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
register: disable_syslog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
|
|
|
|
msg: '{{disable_syslog}}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Query firewall rules
|
|
|
|
|
|
|
|
meraki_mx_l3_firewall:
|
|
|
|
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
|
|
|
|
org_name: '{{test_org_name}}'
|
|
|
|
|
|
|
|
net_name: TestNetAppliance
|
|
|
|
|
|
|
|
state: query
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
register: query
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
|
|
|
|
msg: '{{query.data.1}}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- query.data.1.syslogEnabled == False
|
|
|
|
|
|
|
|
- disable_syslog.changed == True
|
|
|
|
|
|
|
|
|
|
|
|
always:
|
|
|
|
always:
|
|
|
|
- name: Delete all firewall rules
|
|
|
|
- name: Delete all firewall rules
|
|
|
|