Unable to pass dict as a parameter in the ansible module

I am trying to pass a dict as a parameter in the Ansible Module but it is giving me error “{“msg”: “unable to evaluate dictionary for devices”, “failed”: true}”

Devices is the parameter below which i am trying to pass, please help

ansible/hacking/test-module -m /usr/share/ansible/monitoring/my_maintenance.py -a “schedule_type=“One-Time” devices=”{“hostName”:“HYDLPT326”}" start_time=2015-06-01T16:00:00+0000 end_time=2015-06-01T16:30:00+0000 timezone=“Asia/Calcutta” client_id=client_2655"

O/p is below

I was running into the same issue, and your post helped me out.

Looks like a quoting issue. I’ve escaped some of the double-quotes and switched to single quotes inside the dictionary. Maybe try this:

test-module -m /usr/share/ansible/monitoring/my_maintenance.py -a “schedule_type=One-Time devices="{‘hostName’:‘HYDLPT326’}" start_time=2015-06-01T16:00:00+0000 end_time=2015-06-01T16:30:00+0000 timezone=‘Asia/Calcutta’ client_id=client_2655”

I was missing the double-quotes around the dictionary.

Good luck!