|
|
@ -1,8 +1,9 @@
|
|
|
|
# Test code for the Meraki Organization module
|
|
|
|
# Test code for the Meraki VLAN module
|
|
|
|
# Copyright: (c) 2018, Kevin Breit (@kbreit)
|
|
|
|
# Copyright: (c) 2018, Kevin Breit (@kbreit)
|
|
|
|
|
|
|
|
|
|
|
|
# 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:
|
|
|
|
- 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
|
|
|
@ -13,7 +14,7 @@
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
host: marrrraki.com
|
|
|
|
host: marrrraki.com
|
|
|
|
state: present
|
|
|
|
state: present
|
|
|
|
org_name: '{{test_org_name}}'
|
|
|
|
org_name: IntTestOrg
|
|
|
|
output_level: debug
|
|
|
|
output_level: debug
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_to: localhost
|
|
|
|
register: invalid_domain
|
|
|
|
register: invalid_domain
|
|
|
@ -24,7 +25,6 @@
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
auth_key: '{{ auth_key }}'
|
|
|
|
use_https: false
|
|
|
|
use_https: false
|
|
|
|
state: query
|
|
|
|
state: query
|
|
|
|
org_name: '{{test_org_name}}'
|
|
|
|
|
|
|
|
output_level: debug
|
|
|
|
output_level: debug
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_to: localhost
|
|
|
|
register: http
|
|
|
|
register: http
|
|
|
@ -160,7 +160,7 @@
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- update_vlan_add_ip.changed == True
|
|
|
|
- update_vlan_add_ip.changed == True
|
|
|
|
- update_vlan_add_ip.data.fixedIpAssignments | length == 2
|
|
|
|
- update_vlan_add_ip.data.fixedIpAssignments | length == 2
|
|
|
|
- update_vlan_add_ip.data.reservedIpRanges | length == 2
|
|
|
|
- update_vlan_add_ip.data.reservedIpRange | length == 2
|
|
|
|
|
|
|
|
|
|
|
|
- name: Remove IP assignments and reserved IP ranges
|
|
|
|
- name: Remove IP assignments and reserved IP ranges
|
|
|
|
meraki_vlan:
|
|
|
|
meraki_vlan:
|
|
|
@ -191,7 +191,7 @@
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- update_vlan_remove_ip.changed == True
|
|
|
|
- update_vlan_remove_ip.changed == True
|
|
|
|
- update_vlan_remove_ip.data.fixedIpAssignments | length == 1
|
|
|
|
- update_vlan_remove_ip.data.fixedIpAssignments | length == 1
|
|
|
|
- update_vlan_remove_ip.data.reservedIpRanges | length == 1
|
|
|
|
- update_vlan_remove_ip.data.reservedIpRange | length == 1
|
|
|
|
|
|
|
|
|
|
|
|
- name: Update VLAN with idempotency
|
|
|
|
- name: Update VLAN with idempotency
|
|
|
|
meraki_vlan:
|
|
|
|
meraki_vlan:
|
|
|
@ -289,6 +289,10 @@
|
|
|
|
- query_vlan.data.id == 2
|
|
|
|
- query_vlan.data.id == 2
|
|
|
|
- query_vlan.changed == False
|
|
|
|
- query_vlan.changed == False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
always:
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
# Tear down starts here
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
- name: Delete VLAN
|
|
|
|
- name: Delete VLAN
|
|
|
|
meraki_vlan:
|
|
|
|
meraki_vlan:
|
|
|
|
auth_key: '{{auth_key}}'
|
|
|
|
auth_key: '{{auth_key}}'
|
|
|
|