@ -4,37 +4,37 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- block:
# - name: Test an API key is provided
# fail:
# msg: Please define an API key
# when: auth_key is not defined
- name : Test an API key is provided
fail:
msg : Please define an API key
when : auth_key is not defined
# - name: Use an invalid domain
# meraki_organization:
# auth_key: '{{ auth_key }}'
# host: marrrraki.com
# state: present
# org_name: IntTestOrg
# output_level: debug
# delegate_to: localhost
# register: invalid_domain
# ignore_errors: yes
- name : Use an invalid domain
meraki_organization:
auth_key : '{{ auth_key }}'
host : marrrraki.com
state : present
org_name : IntTestOrg
output_level : debug
delegate_to : localhost
register : invalid_domain
ignore_errors : yes
# - name: Disable HTTP
# meraki_organization:
# auth_key: '{{ auth_key }}'
# use_https: false
# state: query
# output_level: debug
# delegate_to: localhost
# register: http
# ignore_errors: yes
# - name: Connection assertions
# assert:
# that:
# - '"Failed to connect to" in invalid_domain.msg'
# - '"http" in http.url'
- name : Disable HTTP
meraki_organization:
auth_key : '{{ auth_key }}'
use_https : false
state : query
output_level : debug
delegate_to : localhost
register : http
ignore_errors : yes
- name : Connection assertions
assert:
that:
- '"Failed to connect to" in invalid_domain.msg'
- '"http" in http.url'
- name : Create network
meraki_network:
@ -54,9 +54,6 @@
delegate_to : localhost
register : query
- debug:
msg : '{{query}}'
- assert:
that:
- query.data|length == 1
@ -78,6 +75,9 @@
delegate_to : localhost
register : create_one
- debug:
var : create_one
- assert:
that:
- create_one.data|length == 2
@ -85,6 +85,7 @@
- create_one.data.0.protocol == 'tcp'
- create_one.data.0.policy == 'deny'
- create_one.changed == True
- create_one.data is defined
- name : Check for idempotency
meraki_mx_l3_firewall:
@ -109,6 +110,7 @@
- assert:
that:
- create_one_idempotent.changed == False
- create_one_idempotent.data is defined
- name : Create syslog in network
meraki_syslog:
@ -145,6 +147,10 @@
- debug:
msg : '{{default_syslog}}'
- assert:
that:
- default_syslog.data is defined
- name : Query firewall rules
meraki_mx_l3_firewall:
auth_key : '{{ auth_key }}'
@ -183,6 +189,10 @@
- debug:
msg : '{{disable_syslog}}'
- assert:
that:
- disable_syslog.data is defined
- name : Query firewall rules
meraki_mx_l3_firewall:
auth_key : '{{ auth_key }}'
@ -210,3 +220,11 @@
rules : [ ]
delegate_to : localhost
register : delete_all
- name : Delete network
meraki_network:
auth_key : '{{ auth_key }}'
org_name : '{{test_org_name}}'
net_name : TestNetAppliance
state : absent
delegate_to : localhost