ec2_metric_alarm is failling when passing dimensions argument

I need to create an alarm associated with one of my AWS instances. For that I’m using the following task:

  • name: Create CPU utilization metric alarm
    sudo: false
    local_action: ec2_metric_alarm state=present region=us-east-1 name=“Alarm Name” metric=“CPUUtilization” statistic=Average comparison=“>=” threshold=80.0 unit=“Percent” period=300 evaluation_periods=1 description=“It will be triggered when CPU utilization is more than 80% for 5 minutes” dimensions={‘InstanceId’:‘i-abcdefg’}

And it is failling with this error:

failed: [ec2-54-237-178-129.compute-1.amazonaws.com] => {“failed”: true, “parsed”: false}
invalid output was: Traceback (most recent call last):
File “/home/douglas/.ansible/tmp/ansible-tmp-1403716886.08-63354845163799/ec2_metric_alarm”, line 1670, in
main()
File “/home/douglas/.ansible/tmp/ansible-tmp-1403716886.08-63354845163799/ec2_metric_alarm”, line 1655, in main
module = AnsibleModule(argument_spec=argument_spec)
File “/home/douglas/.ansible/tmp/ansible-tmp-1403716886.08-63354845163799/ec2_metric_alarm”, line 337, in init
self._check_argument_types()
File “/home/douglas/.ansible/tmp/ansible-tmp-1403716886.08-63354845163799/ec2_metric_alarm”, line 837, in _check_argument_types
(result, exc) = self.safe_eval(value, dict(), include_exceptions=True)
AttributeError: ‘AnsibleModule’ object has no attribute ‘safe_eval’

FATAL: all hosts have already failed – aborting

Looks like it is trying to parse the dimensions argument as dict() but cannot do that.
Any help is appreciated.

Regards,
Douglas

This sounds like this may be a mixed version of Ansible to me, an old library or something half running out of devel and half an install.

Is it possible to force upgrading all dependencies? All I did to get 1.6.5 was running:

$ sudo pip install boto --upgrade
$ sudo pip install ansible --upgrade

Thanks for your time.
Regards,
Douglas

I just read this blog post (http://blog.willmer.org/2007/12/attributeerror-module-object-has-no-attribute-blah/) and started thinking this might be a problem.
Do we need the init.py file copied over to the directory where the ec2_metric_alarm script runs?

Hope to hear from you.
Thanks.

Sorry for top posting over and over.
A bug was already reported and should cover this error:

https://github.com/ansible/ansible/issues/7679

Any known workarround?

Thanks.
Regards,
Douglas