@ -8,24 +8,8 @@
fail:
msg : Please define an API key
when : auth_key is not defined
- name : Use an invalid domain
meraki_config_template:
auth_key : '{{ auth_key }}'
host : marrrraki.com
state : query
org_name : DevTestOrg
output_level : debug
delegate_to : localhost
register : invalid_domain
ignore_errors : yes
- name : Connection assertions
assert:
that:
- '"Failed to connect to" in invalid_domain.msg'
- name : Create network with type switch
- name : Create network
meraki_network:
auth_key : '{{ auth_key }}'
state : present
@ -36,6 +20,38 @@
delegate_to : localhost
register : create_net_appliance
- name : Test net_name and id exclusivity
meraki_content_filtering:
auth_key : '{{auth_key}}'
org_name : '{{test_org_name}}'
net_name : '{{test_net_name}}'
net_id : 12345
state : present
allowed_urls:
- "http://www.ansible.com/*"
register : net_exclusive
ignore_errors : yes
- assert:
that:
- 'net_exclusive.msg == "net_name and net_id are mutually exclusive"'
- name : Set single allowed URL pattern with check mode
meraki_content_filtering:
auth_key : '{{auth_key}}'
org_name : '{{test_org_name}}'
net_name : '{{test_net_name}}'
state : present
allowed_urls:
- "http://www.ansible.com/*"
register : single_allowed_check
check_mode : yes
- assert:
that:
- single_allowed_check.data.allowedUrlPatterns | length == 1
- single_allowed_check is changed
- name : Set single allowed URL pattern
meraki_content_filtering:
auth_key : '{{auth_key}}'
@ -46,12 +62,27 @@
- "http://www.ansible.com/*"
register : single_allowed
- assert:
that:
- single_allowed.data.allowedUrlPatterns | length == 1
- name : Set single allowed URL pattern for idempotency with check mode
meraki_content_filtering:
auth_key : '{{auth_key}}'
org_name : '{{test_org_name}}'
net_name : '{{test_net_name}}'
state : present
allowed_urls:
- "http://www.ansible.com/*"
register : single_allowed_idempotent_check
check_mode : yes
- debug:
var : single_allowed.data.allowedUrlPatterns
var : single_allowed _idempotent_check
- assert:
that:
- single_allowed.data.allowedUrlPatterns | length == 1
- single_allowed _idempotent_check is not changed
- name : Set single allowed URL pattern for idempotency
meraki_content_filtering:
@ -116,16 +147,36 @@
category_list_size : full list
blocked_categories:
- "Adult and Pornography"
register : blocked_cateogry
register : blocked_category
- debug:
var : blocked_category
- assert:
that:
- blocked_category.changed == True
- blocked_category.data.blockedUrlCategories | length == 1
- blocked_category.data.urlCategoryListSize == "fullList"
- name : Set blocked URL category with top sites
meraki_content_filtering:
auth_key : '{{auth_key}}'
org_name : '{{test_org_name}}'
net_name : '{{test_net_name}}'
state : present
category_list_size : top sites
blocked_categories:
- "Adult and Pornography"
register : blocked_category
- debug:
var : blocked_cateogry
var : blocked_cate go ry
- assert:
that:
- blocked_cateogry.changed == True
- blocked_cateogry.data.blockedUrlCategories | length == 1
- blocked_cateogry.data.urlCategoryListSize == "fullList"
- blocked_cate go ry.changed == True
- blocked_cate go ry.data.blockedUrlCategories | length == 1
- blocked_cate gory.data.urlCategoryListSize == "topSites "
always:
- name : Reset policies
@ -139,5 +190,3 @@
-
blocked_urls:
-
# blocked_categories:
# -