Issue creating Cloudwatch alarms

150 views
Skip to first unread message

Stephen Gargan

unread,
Oct 23, 2014, 5:44:03 AM10/23/14
to ansible...@googlegroups.com
I'm trying to create some alarms using the metrics module. I'm using pretty much the exact example given in the docs

- name: create alarm
      ec2_metric_alarm:
        state: present
        region: us-west-2
        name: "cpu-low"
        metric: "CPUUtilization"
        namespace: "AWS/EC2"
        statistic: Average
        comparison: "<="
        threshold: 5.0
        period: 300
        evaluation_periods: 3
        unit: "Percent"
        description: "This will alarm when a bamboo slave's cpu usage average is lower than 5% for 15 minutes "
        dimensions: {'InstanceId':'{{ansible_ec2_instance_id}}'}
        alarm_actions: ['{{alarm_sns}}']

But I get a failure from boto saying that the security token is unexpected.
 
  File "/usr/lib/python2.7/dist-packages/boto/regioninfo.py", line 62, in connect
    return self.connection_cls(region=self, **kw_params)
TypeError: __init__() got an unexpected keyword argument 'security_token'

I've tried setting and unsetting the access and secret keys but this makes no difference. I'm running from a checkout,

ansible 1.8 (devel 707474a43a) last updated 2014/10/22 15:22:23 (GMT +100)
  lib/ansible/modules/core: (detached HEAD 88b73afcbe) last updated 2014/10/22 17:32:44 (GMT +100)
  lib/ansible/modules/extras: (detached HEAD a0df36c6ab) last updated 2014/10/22 17:33:05 (GMT +100)
  v2/ansible/modules/core: (detached HEAD cb69744bce) last updated 2014/10/22 17:32:17 (GMT +100)
  v2/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 2014/10/22 17:32:32 (GMT +100)
  configured module search path = None

And have boto 2.33 installed.

Anyone seen this or know what might be up?

Thanks,

Steve.

James Cammarata

unread,
Oct 23, 2014, 11:07:45 AM10/23/14
to ansible...@googlegroups.com
Hi Stephen,

That's a very odd error, since the boto docs (http://boto.readthedocs.org/en/latest/ref/cloudwatch.html) show that security_token is, in fact, a valid parameter for the connection. Looking at some older versions of the doc, that param was not listed in the cloudwatch connection class so you may want to verify there are not multiple versions of boto installed. 

Alternatively, since I see you're not running this as a local_action or "delegate_to: localhost", make sure you have the correct version of boto installed on the system where the module is executing, assuming your "- hosts:" list is not localhost.


--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/dbf432d5-7fac-406f-a30f-436ae8a40fd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael DeHaan

unread,
Oct 24, 2014, 9:22:16 AM10/24/14
to ansible...@googlegroups.com
Also, a traceback is always a bug, please file a ticket on this in the ansible/ansible-modules-core repo so we can catch it.



Reply all
Reply to author
Forward
0 new messages