diff --git a/changelogs/fragments/51100-meraki_device-notes-support.yml b/changelogs/fragments/51100-meraki_device-notes-support.yml new file mode 100644 index 00000000000..d0152284dc2 --- /dev/null +++ b/changelogs/fragments/51100-meraki_device-notes-support.yml @@ -0,0 +1,2 @@ +minor_changes: + - "meraki_device - Add support for attaching notes to a device." diff --git a/lib/ansible/modules/network/meraki/meraki_device.py b/lib/ansible/modules/network/meraki/meraki_device.py index c4f9587acdb..31e29f56692 100644 --- a/lib/ansible/modules/network/meraki/meraki_device.py +++ b/lib/ansible/modules/network/meraki/meraki_device.py @@ -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') diff --git a/test/integration/targets/meraki_device/tasks/main.yml b/test/integration/targets/meraki_device/tasks/main.yml index 3750244b7fb..1dd678ac205 100644 --- a/test/integration/targets/meraki_device/tasks/main.yml +++ b/test/integration/targets/meraki_device/tasks/main.yml @@ -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: