Skip to content

Commit 8506de3

Browse files
authored
Merge pull request #17 from wwt/certified_update
Bugfixes and Data Model Updates
2 parents 1d23093 + b6f12d1 commit 8506de3

File tree

12 files changed

+100
-44
lines changed

12 files changed

+100
-44
lines changed

.ansible-lint

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
exclude_paths:
3+
- .cache/
4+
- changelogs/

.github/workflows/ci.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ on:
1313
- cron: '0 0 * * *'
1414

1515
jobs:
16-
changelog:
17-
uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main
18-
if: github.event_name == 'pull_request'
1916
ansible-lint:
2017
uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main
2118
all_green:
2219
if: ${{ always() }}
2320
needs:
24-
- changelog
2521
- ansible-lint
2622
runs-on: ubuntu-latest
2723
steps:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ scratch/
162162
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
163163
#.idea/
164164

165-
changelogs/.plugin_cache
165+
changelogs/.plugin_cache.yaml

CHANGELOG.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,32 @@
22

33
**Topics**
44

5+
- <a href="#v1-1-2">v1\.1\.2</a>
6+
- <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
7+
- <a href="#bugfixes">Bugfixes</a>
58
- <a href="#v1-1-1">v1\.1\.1</a>
69
- <a href="#minor-changes">Minor Changes</a>
7-
- <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
10+
- <a href="#breaking-changes--porting-guide-1">Breaking Changes / Porting Guide</a>
811
- <a href="#v1-1-0">v1\.1\.0</a>
912
- <a href="#release-summary">Release Summary</a>
1013
- <a href="#new-plugins">New Plugins</a>
1114
- <a href="#lookup">Lookup</a>
1215

16+
<a id="v1-1-2"></a>
17+
## v1\.1\.2
18+
19+
<a id="breaking-changes--porting-guide"></a>
20+
### Breaking Changes / Porting Guide
21+
22+
* manage\_meraki\_network \- updated data model so that tags are now a list
23+
24+
<a id="bugfixes"></a>
25+
### Bugfixes
26+
27+
* configure\_meraki\_mt \- fixed conditional preventing lookup dictionary creation
28+
* configure\_meraki\_mx \- fixed VLAN provisioning and updates due to VLAN 1 already existing
29+
* manage\_meraki\_network \- fixed device provisioning to include name and tags
30+
1331
<a id="v1-1-1"></a>
1432
## v1\.1\.1
1533

@@ -18,7 +36,7 @@
1836

1937
* configure\_meraki\_mv \- Updated data handling for MQTT configuration with camera sense\.
2038

21-
<a id="breaking-changes--porting-guide"></a>
39+
<a id="breaking-changes--porting-guide-1"></a>
2240
### Breaking Changes / Porting Guide
2341

2442
* configure\_meraki\_mr \- Data model updated to support migration to latest cisco\.meraki certified collection\.

changelogs/changelog.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,16 @@ releases:
2929
- 1.1.0-update.yaml
3030
- 1.1.1-minor.yaml
3131
release_date: '2024-05-30'
32+
1.1.2:
33+
changes:
34+
breaking_changes:
35+
- manage_meraki_network - updated data model so that tags are now a list
36+
bugfixes:
37+
- configure_meraki_mt - fixed conditional preventing lookup dictionary creation
38+
- configure_meraki_mx - fixed VLAN provisioning and updates due to VLAN 1 already
39+
existing
40+
- manage_meraki_network - fixed device provisioning to include name and tags
41+
fragments:
42+
- v1.1.2-breaking.yaml
43+
- v1.1.2-bugfixes.yaml
44+
release_date: '2024-05-31'

changelogs/fragments/.keep

Whitespace-only changes.

galaxy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace: wwt
99
name: meraki
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: 1.1.1
12+
version: 1.1.2
1313

1414
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1515
readme: README.md

roles/configure_meraki_mt/tasks/configure_mqtt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
loop: "{{ broker_result.results }}"
6868
loop_control:
6969
loop_var: result
70-
when: not result.skipped
70+
when: result.skipped is not defined
7171

7272
- name: Enable MQTT Brokers
7373
cisco.meraki.networks_sensor_mqtt_brokers:

roles/configure_meraki_mx/meta/argument_specs.yml

+5-30
Original file line numberDiff line numberDiff line change
@@ -530,42 +530,12 @@ argument_specs:
530530
elements: dict
531531
description: Layer 7 Firewall Rules
532532
options:
533-
application:
534-
type: dict
535-
required: false
536-
description: Application to filter
537-
options:
538-
id:
539-
type: str
540-
required: false
541-
description: URI of application as defined by Meraki
542-
name:
543-
type: str
544-
required: false
545-
description: Name of application as defined by Meraki
546-
countries:
547-
type: list
548-
required: false
549-
description: List of countries - two leter ISO 3166-1 alpha-2
550-
elements: str
551-
host:
552-
type: str
553-
required: false
554-
description: FQDN of host to filter
555-
ipRange:
556-
type: str
557-
required: false
558-
description: CIDR range of IP, can append port with ":"
559533
policy:
560534
type: str
561535
required: false
562536
description: Policy to apply
563537
choices:
564538
- deny
565-
port:
566-
type: str
567-
required: false
568-
description: TCP or UDP port to filter
569539
type:
570540
type: str
571541
required: false
@@ -578,3 +548,8 @@ argument_specs:
578548
- ipRange
579549
- port
580550
- allowedCountries
551+
value:
552+
type: list
553+
elements: str
554+
required: false
555+
description: Rule Value

roles/configure_meraki_mx/tasks/configure_vlans.yml

+49-2
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,52 @@
11
---
2-
- name: Initial Configuration of MX VLANs for {{ appliance.name }}
2+
- name: Query Existing MX VLANs
3+
cisco.meraki.networks_appliance_vlans_info:
4+
meraki_api_key: "{{ auth_key }}"
5+
networkId: "{{ network_id }}"
6+
register: vlan_result
7+
8+
- name: Add discovered VLAN IDs to list
9+
ansible.builtin.set_fact:
10+
vlan_ids: >-
11+
{{ vlan_ids | default([]) + [result.id] }}
12+
loop: "{{ vlan_result.meraki_response }}"
13+
loop_control:
14+
loop_var: result
15+
when: vlan_result is defined
16+
17+
#
18+
# First pass configuration throws the following errors when run
19+
# when vlanId parameter is omitted:
20+
# Error: Appliance.getNetworkApplianceVlan() missing 1 required positional argument: 'vlanId'
21+
#
22+
# When vlanId parameter is present:
23+
# Error: An error occured when executing operation.
24+
# The error was: appliance, getNetworkApplianceVlan - 404 Not Found, please wait a minute if the key or org was just newly created.
25+
#
26+
# VLANs are provisioned correctly regardless of error as noted above
27+
#
28+
29+
- name: First Pass Configuration of MX VLANs for {{ appliance.name }}
330
cisco.meraki.networks_appliance_vlans:
431
meraki_api_key: "{{ auth_key }}"
532
state: "{{ vlan.state }}"
633
networkId: "{{ network_id }}"
734
id: "{{ vlan.id }}"
35+
vlanId: "{{ vlan.id }}"
836
name: "{{ vlan.name | default(omit) }}"
937
subnet: "{{ vlan.subnet | default(omit) }}"
1038
applianceIp: "{{ vlan.appliance_ip | default(omit) }}"
1139
loop: "{{ appliance.vlans }}"
1240
loop_control:
1341
loop_var: vlan
42+
when: vlan.id not in vlan_ids and vlan.state == "present"
1443

1544
- name: Second Pass Configuration of MX VLANs for {{ appliance.name }}
1645
cisco.meraki.networks_appliance_vlans:
1746
meraki_api_key: "{{ auth_key }}"
1847
state: "{{ vlan.state }}"
1948
networkId: "{{ network_id }}"
20-
id: "{{ vlan.id }}"
49+
vlanId: "{{ vlan.id }}"
2150
name: "{{ vlan.name | default(omit) }}"
2251
reservedIpRanges: "{{ vlan.reserved_ip_range | default(omit) }}"
2352
fixedIpAssignments: "{{ vlan.fixed_ip_assignments | default(omit) }}"
@@ -29,4 +58,22 @@
2958
((vlan.reserved_ip_range is defined) or
3059
(vlan.fixed_ip_assignments is defined) or
3160
(vlan.dns_nameservers is defined)) and
61+
vlan.id not in vlan_ids and
3262
vlan.state == "present"
63+
64+
- name: Update Configuration of Existing MX VLANs for {{ appliance.name }}
65+
cisco.meraki.networks_appliance_vlans:
66+
meraki_api_key: "{{ auth_key }}"
67+
state: "{{ vlan.state }}"
68+
networkId: "{{ network_id }}"
69+
vlanId: "{{ vlan.id }}"
70+
name: "{{ vlan.name | default(omit) }}"
71+
subnet: "{{ vlan.subnet | default(omit) }}"
72+
applianceIp: "{{ vlan.appliance_ip | default(omit) }}"
73+
reservedIpRanges: "{{ vlan.reserved_ip_range | default(omit) }}"
74+
fixedIpAssignments: "{{ vlan.fixed_ip_assignments | default(omit) }}"
75+
dnsNameservers: "{{ vlan.dns_nameservers | default(omit) }}"
76+
loop: "{{ appliance.vlans }}"
77+
loop_control:
78+
loop_var: vlan
79+
when: vlan.id in vlan_ids and vlan.state == "present"

roles/manage_meraki_network/meta/argument_specs.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ argument_specs:
4949
- present
5050
- absent
5151
tags:
52-
type: str
52+
type: list
53+
elements: str
5354
required: false
54-
description: Meraki Dashboard Tags (CSV list)
55+
description: Meraki Dashboard Tags
5556
address:
5657
type: str
5758
required: false

roles/manage_meraki_network/tasks/manage_devices.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
- name: Update Network Devices
4848
block:
49-
- name: Add Location Information to Network Devices
49+
- name: Add Name and Location Information to Network Devices
5050
ansible.builtin.uri:
5151
url: "{{ dashboard_base_url }}/devices/{{ device.serial }}"
5252
method: PUT
@@ -56,8 +56,10 @@
5656
X-Cisco-Meraki-API-Key: "{{ auth_key }}"
5757
body_format: json
5858
body:
59+
name: "{{ device.name }}"
5960
address: "{{ network.address | default(omit) }}"
6061
moveMapMarker: "{{ 'true' if network.address | default(omit) }}"
62+
tags: "{{ device.tags | default(omit) }}"
6163
changed_when: api_result.status == 200
6264
until: api_result.status != 429
6365
delay: 5

0 commit comments

Comments
 (0)