--
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/647db18b-4fb6-4542-806f-52f1439721ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---
- name: Start Autoscaling Configurations
hosts: awsserver
gather_facts: no
tasks:
- name: Autoscaling Starts Now...!!!!!
local_action:
module: ec2_scaling_policy
region: us-east-1
name: "{{ item.name }}"
asg_name: "testing-ASG"
state: present
adjustment_type: "{{ item.adjustment_type }}"
min_adjustment_step: "{{ item.min_adjustment_step }}"
scaling_adjustment: "{{ item.scaling_adjustment }}"
cooldown: "{{ item.cooldown }}"
with_items:
- name: "Increase Group Size"
adjustment_type: "ChangeInCapacity"
scaling_adjustment: +1
min_adjustment_step: 1
cooldown: 170
- name: "Decrease Group Size"
adjustment_type: "ChangeInCapacity"
scaling_adjustment: -1
min_adjustment_step: 1
cooldown: 290
register: autoscaling
- name: Create or delete AWS metric alarms metrics you wish to alarm on must already exists
local_action:
module: ec2_metric_alarm
region: us-east-1
name: "{{ item.name }}"
state: present
metric: "CPUUtilization"
namespace: "AWS/EC2"
statistic: "Average"
comparison: "{{ item.comparison }}"
threshold: "{{ item.threshold }}"
period: 60
evaluation_periods: 3
unit: "Percent"
dimensions:
AutoScalingGroupName: "testing-ASG"
alarm_actions: "{{ item.alarm_actions }}"
with_items:
- name: "testing-SCALE-UP"
comparison: ">="
threshold: 70.0
alarm_actions:
- '{{ autoscaling.results[0].arn }}'
- 'arn:aws:sns:us-east-1:465404420665:Polanotify'
- name: "testing-SCALE-DOWN"
comparison: "<="
threshold: 20.0
alarm_actions:
- '{{ autoscaling.results[1].arn }}'
- 'arn:aws:sns:us-east-1:465404420665:Polanotify'
So, I have done the above part.. What could be the possible problem ?.. I want to see the notification in "Notification" tab with this script.