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!
On Monday, June 1, 2015 at 8:44:21 AM UTC-4, Dheeraj Panyam wrote:
>
> 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
> ----------------
>
> ***********************************
> RAW OUTPUT
> {"msg": "unable to evaluate dictionary for devices", "failed": true}
>
>
> ***********************************
> PARSED OUTPUT
> {
> "failed": true,
> "msg": "unable to evaluate dictionary for devices"
> }
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/db1a645d-615a-4783-9f99-83a767c08f3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.