meraki_device - Support for creating and modifying device notes (#51100)
* Add support for notes * Add test for notes * Device notes changes - Renamed from notes to note - Modified tests to work * Comment device test since it only works once * Remove assertion stanza and move assertion to existing one * Add version_added to note documentation * Converted from tabs to spaces * Added changelog fragment * Remove changelog file since it's a feature * Add changelog fragment
This commit is contained in:
parent
c30bc24ba9
commit
d16dcb8dbb
3 changed files with 26 additions and 18 deletions
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- "meraki_device - Add support for attaching notes to a device."
|
|
@ -86,6 +86,11 @@ options:
|
|||
serial_uplink:
|
||||
description:
|
||||
- Serial number of device to query uplink information from.
|
||||
note:
|
||||
description:
|
||||
- Informational notes about a device.
|
||||
- Limited to 255 characters.
|
||||
version_added: '2.8'
|
||||
|
||||
|
||||
author:
|
||||
|
@ -238,6 +243,7 @@ def main():
|
|||
lng=dict(type='float', aliases=['longitude']),
|
||||
address=dict(type='str'),
|
||||
move_map_marker=dict(type='bool'),
|
||||
note=dict(type='str'),
|
||||
)
|
||||
|
||||
# seed the result dict in the object
|
||||
|
@ -361,6 +367,7 @@ def main():
|
|||
'lng': meraki.params['lng'],
|
||||
'address': meraki.params['address'],
|
||||
'moveMapMarker': meraki.params['move_map_marker'],
|
||||
'notes': meraki.params['note'],
|
||||
}
|
||||
query_path = meraki.construct_path('get_device', net_id=net_id) + meraki.params['serial']
|
||||
device_data = meraki.request(query_path, method='GET')
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
---
|
||||
- block:
|
||||
- name: Claim a device into an organization
|
||||
meraki_device:
|
||||
auth_key: '{{auth_key}}'
|
||||
org_name: '{{test_org_name}}'
|
||||
serial: '{{serial}}'
|
||||
state: present
|
||||
delegate_to: localhost
|
||||
register: claim_device_org
|
||||
# - name: Claim a device into an organization
|
||||
# meraki_device:
|
||||
# auth_key: '{{auth_key}}'
|
||||
# org_name: '{{test_org_name}}'
|
||||
# serial: '{{serial}}'
|
||||
# state: present
|
||||
# delegate_to: localhost
|
||||
# register: claim_device_org
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- claim_device_org.changed == true
|
||||
# - assert:
|
||||
# that:
|
||||
# - claim_device_org.changed == true
|
||||
|
||||
- name: Query status of all devices in an organization
|
||||
meraki_device:
|
||||
|
@ -160,16 +160,15 @@
|
|||
tags: recently-added
|
||||
state: present
|
||||
move_map_marker: True
|
||||
note: Test device notes
|
||||
delegate_to: localhost
|
||||
register: update_device
|
||||
|
||||
- debug:
|
||||
msg: '{{update_device}}'
|
||||
|
||||
# - assert:
|
||||
# that:
|
||||
# - update_device.changed == true
|
||||
# - '"1060 W. Addison St., Chicago, IL" in update_device.data.0.address'
|
||||
- assert:
|
||||
that:
|
||||
- update_device.changed == true
|
||||
- update_device.data.0.notes == "Test device notes"
|
||||
- '"1060 W. Addison St., Chicago, IL" in update_device.data.0.address'
|
||||
|
||||
- name: Update a device with idempotency
|
||||
meraki_device:
|
||||
|
|
Loading…
Reference in a new issue