[Ansible] Unable to claim devices for network

Solved
scoop263
Here to help

[Ansible] Unable to claim devices for network

Hi,

 

Recently I had an ansible play stop working.

 

The error I am getting is:

The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/ansible/executor/task_executor.py", line 165, in run
    res = self._execute()
          ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ansible/executor/task_executor.py", line 637, in _execute
    result = self._handler.run(task_vars=vars_copy)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/srv_semaphore/.ansible/collections/ansible_collections/cisco/meraki/plugins/action/networks_devices_claim.py", line 83, in run
    response = meraki.exec_meraki(
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/srv_semaphore/.ansible/collections/ansible_collections/cisco/meraki/plugins/plugin_utils/meraki.py", line 306, in exec_meraki
    response = func(**params)
               ^^^^^^^^^^^^^^
TypeError: Networks.claimNetworkDevices() got an unexpected keyword argument 'addAtomically'
fatal: [n834.meraki.com]: FAILED! => {
    "msg": "Unexpected failure during module execution: Networks.claimNetworkDevices() got an unexpected keyword argument 'addAtomically'",
    "stdout": ""
}

I noticed this error, and updated my collections to 2.20.5

 

I have updated the Meraki SDK on my machine.

 

However this is still not working as intended.

 

Here are my two plays

 

The top one is the original, and the bottom one is a test claim play but both result in the same error as above.

 

- name: Assign Primary MX Device to Network
  cisco.meraki.networks_devices_claim:
    meraki_api_key: "{{meraki_api_key}}"
    networkId: "{{ meraki_Response.meraki_response.id }}"
    serials:
      - "{{ MX_1 }}"

- name: Test Claim
  cisco.meraki.networks_devices_claim:
    addAtomically: true
    meraki_api_key: "{{meraki_api_key}}"
    networkId: "{{ meraki_Response.meraki_response.id }}"
    serials:
      - "{{ MX_1 }}"

 

Any help will be much appreciated.

Thank you.

1 Accepted Solution
scoop263
Here to help

I resolved the issue.
In our environment, we are using Semaphore for Ansible, and what happened was Semaphore is using a different python module location, which was using an out of date Meraki SDK, than what any other account in the Linux box uses.

View solution in original post

2 Replies 2
Inderdeep
Kind of a big deal

scoop263
Here to help

I resolved the issue.
In our environment, we are using Semaphore for Ansible, and what happened was Semaphore is using a different python module location, which was using an out of date Meraki SDK, than what any other account in the Linux box uses.

Get notified when there are additional replies to this discussion.