D'oh, looks like I was still on 1.6.6. Using the devel branch now and it works, thanks!
On Monday, July 14, 2014 2:10:35 PM UTC-5, James Cammarata wrote: > > What version of Ansible are you running? The above PR was merged into > devel and will be included in 1.7, however it is not yet available in 1.6.x. > > > On Mon, Jul 14, 2014 at 1:42 PM, Claire Lee <[email protected] > <javascript:>> wrote: > >> Hi guys, I'm still pretty new to Ansible and was wondering if you could >> answer a question I have. >> >> I'm trying to create an AWS scaling policy and attach a metric alarm to >> it. From what I understand, the ec2_metric_alarm module needs the ARN of >> the scaling policy so that it can associate itself with it. However, I >> can't seem to get the ARN after creating a new scaling policy from the >> ec2_scaling_policy module's output. Currently I'm trying to register the >> result of the ec2_scaling policy module. For example, my playbook looks >> something like this: >> >> - name: Create scaling policy and associate it with autoscaling group >> ec2_scaling_policy: >> state: present >> region: us-east-1 >> name: "test-scaleup-policy" >> adjustment_type: "ChangeInCapacity" >> asg_name: "test-asg" >> scaling_adjustment: 1 >> min_adjustment_step: 1 >> cooldown: 300 >> register: sp_result >> >> - name: Debug result of scaling policy creation >> debug: var=sp_result >> >> - name: Create metric alarm and associate it with autoscaling policy >> action: >> module: ec2_metric_alarm >> state: present >> alarm_actions: ["{{ sp_result.arn }}"] >> etc... >> >> >> The debug module prints this: >> >> TASK: [Debug] >> ***************************************************************** >> ok: [localhost] => { >> "sg_result": { >> "changed": false, >> "invocation": { >> "module_args": "", >> "module_name": "ec2_scaling_policy" >> }}} >> >> >> According to this merged pull request >> <https://github.com/ansible/ansible/pull/7829>, the ARN should be >> included in the data the module returns. Am I trying to capturing this >> information in the wrong way, e.g. using register when I should be using >> something else? Otherwise, is there something else I should be doing? >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/f3ca0fa1-2b9b-4de1-a0a4-61f2c58e27a3%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/f3ca0fa1-2b9b-4de1-a0a4-61f2c58e27a3%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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/1bc0de63-3def-4efe-b33a-acb27c491411%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
