diff options
author | Benno Joy <bennojoy@gmail.com> | 2015-09-03 17:35:06 +0530 |
---|---|---|
committer | Benno Joy <bennojoy@gmail.com> | 2015-09-03 17:35:06 +0530 |
commit | 2f42cd4b2ce9e0f4968d70baab40dc70bd72cd2c (patch) | |
tree | bce99c9d241653181bb6fc85c7479414782dab22 | |
parent | e278f285aa6f61e45416be28b1e689b4d7607196 (diff) | |
parent | f7f621839ad2063c707506f7eaf5663f113664a7 (diff) | |
download | ansible-modules-core-2f42cd4b2ce9e0f4968d70baab40dc70bd72cd2c.tar.gz |
Merge pull request #1951 from galindro/ec2_asg_termination_policies
Added termination_policies option
-rw-r--r-- | cloud/amazon/ec2_asg.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cloud/amazon/ec2_asg.py b/cloud/amazon/ec2_asg.py index efcd6660..e67d2a07 100644 --- a/cloud/amazon/ec2_asg.py +++ b/cloud/amazon/ec2_asg.py @@ -126,6 +126,13 @@ options: version_added: "1.9" default: yes required: False + termination_policies: + description: + - An ordered list of criteria used for selecting instances to be removed from the Auto Scaling group when reducing capacity. + required: false + default: Default. E.g.: When used to create a new autoscaling group, the “Default” value is used. When used to change an existent autoscaling group, the current termination policies are mantained + choices: ['OldestInstance', 'NewestInstance', 'OldestLaunchConfiguration', 'ClosestToNextInstanceHour', 'Default'] + version_added: "2.0" extends_documentation_fragment: aws """ @@ -421,7 +428,8 @@ def create_autoscaling_group(connection, module): tags=asg_tags, health_check_period=health_check_period, health_check_type=health_check_type, - default_cooldown=default_cooldown) + default_cooldown=default_cooldown, + termination_policies=termination_policies) try: connection.create_auto_scaling_group(ag) @@ -783,7 +791,8 @@ def main(): health_check_period=dict(type='int', default=300), health_check_type=dict(default='EC2', choices=['EC2', 'ELB']), default_cooldown=dict(type='int', default=300), - wait_for_instances=dict(type='bool', default=True) + wait_for_instances=dict(type='bool', default=True), + termination_policies=dict(type='list', default=None) ), ) |