From 5fcef856bce465a09b1fa3f4745fccdd218b8100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Tue, 1 Jul 2014 07:34:55 +0200 Subject: [PATCH 1/6] Adds support for `kern_id` param in ec2_ls module. --- cloud/ec2_lc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cloud/ec2_lc b/cloud/ec2_lc index 2fe0e471f63..4c6c9a067bc 100755 --- a/cloud/ec2_lc +++ b/cloud/ec2_lc @@ -68,6 +68,12 @@ options: required: false default: null aliases: [] + kern_id: + description: + - Kernel id for the EC2 instance + required: false + default: null + aliases: [] spot_price: description: - The spot price you are bidding. Only applies for an autoscaling group with spot instances. @@ -139,6 +145,7 @@ def create_launch_config(connection, module): instance_type = module.params.get('instance_type') spot_price = module.params.get('spot_price') instance_monitoring = module.params.get('instance_monitoring') + kern_id = module.params.get('kern_id') bdm = BlockDeviceMapping() if volumes: @@ -158,8 +165,9 @@ def create_launch_config(connection, module): user_data=user_data, block_device_mappings=[bdm], instance_type=instance_type, - spot_price=spot_price, - instance_monitoring=instance_monitoring) + instance_monitoring=instance_monitoring, + kern_id=kern_id, + spot_price=spot_price) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -196,6 +204,7 @@ def main(): key_name=dict(type='str'), security_groups=dict(type='list'), user_data=dict(type='str'), + kern_id=dict(type='str'), volumes=dict(type='list'), instance_type=dict(type='str'), state=dict(default='present', choices=['present', 'absent']), From 5038b6dc3310f69dbd156f74d3790f80469cfc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Tue, 1 Jul 2014 07:39:06 +0200 Subject: [PATCH 2/6] Adds RAM disk id support for ec2_lc module. --- cloud/ec2_lc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cloud/ec2_lc b/cloud/ec2_lc index 4c6c9a067bc..38234fe311b 100755 --- a/cloud/ec2_lc +++ b/cloud/ec2_lc @@ -68,7 +68,7 @@ options: required: false default: null aliases: [] - kern_id: + kernel_id: description: - Kernel id for the EC2 instance required: false @@ -85,6 +85,12 @@ options: required: false default: false aliases: [] + ramdisk_id: + description: + - A RAM disk id for the instances. + required: false + default: null + aliases: [] extends_documentation_fragment: aws """ @@ -145,7 +151,8 @@ def create_launch_config(connection, module): instance_type = module.params.get('instance_type') spot_price = module.params.get('spot_price') instance_monitoring = module.params.get('instance_monitoring') - kern_id = module.params.get('kern_id') + kernel_id = module.params.get('kernel_id') + ramdisk_id = module.params.get('ramdisk_id') bdm = BlockDeviceMapping() if volumes: @@ -166,8 +173,9 @@ def create_launch_config(connection, module): block_device_mappings=[bdm], instance_type=instance_type, instance_monitoring=instance_monitoring, - kern_id=kern_id, - spot_price=spot_price) + kernel_id=kernel_id, + spot_price=spot_price, + ramdisk_id=ramdisk_id) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -204,12 +212,13 @@ def main(): key_name=dict(type='str'), security_groups=dict(type='list'), user_data=dict(type='str'), - kern_id=dict(type='str'), + kernel_id=dict(type='str'), volumes=dict(type='list'), instance_type=dict(type='str'), state=dict(default='present', choices=['present', 'absent']), spot_price=dict(type='float'), instance_monitoring=dict(default=False, type='bool'), + ramdisk_id=dict(type='str'), ) ) From 3a3afc7ed3ca62574a0e25253a441563b1dbd5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Tue, 1 Jul 2014 07:47:04 +0200 Subject: [PATCH 3/6] Adds support for IAM instance profile in ec2_lc module --- cloud/ec2_lc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cloud/ec2_lc b/cloud/ec2_lc index 38234fe311b..e7ffb3d65cf 100755 --- a/cloud/ec2_lc +++ b/cloud/ec2_lc @@ -91,6 +91,12 @@ options: required: false default: null aliases: [] + instance_profile_name: + description: + - The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instances. + required: false + default: null + aliases: [] extends_documentation_fragment: aws """ @@ -153,6 +159,7 @@ def create_launch_config(connection, module): instance_monitoring = module.params.get('instance_monitoring') kernel_id = module.params.get('kernel_id') ramdisk_id = module.params.get('ramdisk_id') + instance_profile_name = module.params.get('instance_profile_name') bdm = BlockDeviceMapping() if volumes: @@ -175,7 +182,8 @@ def create_launch_config(connection, module): instance_monitoring=instance_monitoring, kernel_id=kernel_id, spot_price=spot_price, - ramdisk_id=ramdisk_id) + ramdisk_id=ramdisk_id, + instance_profile_name=instance_profile_name) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -219,6 +227,7 @@ def main(): spot_price=dict(type='float'), instance_monitoring=dict(default=False, type='bool'), ramdisk_id=dict(type='str'), + instance_profile_name=dict(type='str'), ) ) From dc8a3c09d6595d671877ada202033e29fd5cb88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Tue, 1 Jul 2014 07:50:29 +0200 Subject: [PATCH 4/6] Adds support for EBS optimized instances in ecl_lc module. --- cloud/ec2_lc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cloud/ec2_lc b/cloud/ec2_lc index e7ffb3d65cf..401a972aec3 100755 --- a/cloud/ec2_lc +++ b/cloud/ec2_lc @@ -97,6 +97,12 @@ options: required: false default: null aliases: [] + ebs_optimized: + description: + - Specifies whether the instance is optimized for EBS I/O (true) or not (false). + required: false + default: false + aliases: [] extends_documentation_fragment: aws """ @@ -160,6 +166,7 @@ def create_launch_config(connection, module): kernel_id = module.params.get('kernel_id') ramdisk_id = module.params.get('ramdisk_id') instance_profile_name = module.params.get('instance_profile_name') + ebs_optimized = module.params.get('ebs_optimized') bdm = BlockDeviceMapping() if volumes: @@ -183,7 +190,8 @@ def create_launch_config(connection, module): kernel_id=kernel_id, spot_price=spot_price, ramdisk_id=ramdisk_id, - instance_profile_name=instance_profile_name) + instance_profile_name=instance_profile_name, + ebs_optimized=ebs_optimized) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -228,6 +236,7 @@ def main(): instance_monitoring=dict(default=False, type='bool'), ramdisk_id=dict(type='str'), instance_profile_name=dict(type='str'), + ebs_optimized=dict(default=False, type='bool'), ) ) From bde58eccddd97ffbbe47993083bd9b4d898887d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Tue, 1 Jul 2014 07:53:30 +0200 Subject: [PATCH 5/6] Adds the possibility to attach a public IP address to instances launched into an autoscaling group within a VPC to ec2_lc module. --- cloud/ec2_lc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cloud/ec2_lc b/cloud/ec2_lc index 401a972aec3..2d0a1178e19 100755 --- a/cloud/ec2_lc +++ b/cloud/ec2_lc @@ -103,6 +103,12 @@ options: required: false default: false aliases: [] + associate_public_ip_address: + description: + - Used for Auto Scaling groups that launch instances into an Amazon Virtual Private Cloud. Specifies whether to assign a public IP address to each instance launched in a Amazon VPC. + required: false + default: false + aliases: [] extends_documentation_fragment: aws """ @@ -167,6 +173,7 @@ def create_launch_config(connection, module): ramdisk_id = module.params.get('ramdisk_id') instance_profile_name = module.params.get('instance_profile_name') ebs_optimized = module.params.get('ebs_optimized') + associate_public_ip_address = module.params.get('associate_public_ip_address') bdm = BlockDeviceMapping() if volumes: @@ -191,7 +198,8 @@ def create_launch_config(connection, module): spot_price=spot_price, ramdisk_id=ramdisk_id, instance_profile_name=instance_profile_name, - ebs_optimized=ebs_optimized) + ebs_optimized=ebs_optimized, + associate_public_ip_address=associate_public_ip_address) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -237,6 +245,7 @@ def main(): ramdisk_id=dict(type='str'), instance_profile_name=dict(type='str'), ebs_optimized=dict(default=False, type='bool'), + associate_public_ip_address=dict(type='bool'), ) ) From 6ce4d46d4d0ad49cc25f62a26122053fb2d36804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Tue, 1 Jul 2014 07:55:51 +0200 Subject: [PATCH 6/6] Adds support for instance monitoring in ec2_lc module. --- cloud/ec2_lc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud/ec2_lc b/cloud/ec2_lc index 2d0a1178e19..b9b6f3eb845 100755 --- a/cloud/ec2_lc +++ b/cloud/ec2_lc @@ -193,13 +193,13 @@ def create_launch_config(connection, module): user_data=user_data, block_device_mappings=[bdm], instance_type=instance_type, - instance_monitoring=instance_monitoring, kernel_id=kernel_id, spot_price=spot_price, ramdisk_id=ramdisk_id, instance_profile_name=instance_profile_name, ebs_optimized=ebs_optimized, - associate_public_ip_address=associate_public_ip_address) + associate_public_ip_address=associate_public_ip_address, + instance_monitoring=instance_monitoring) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -241,11 +241,11 @@ def main(): instance_type=dict(type='str'), state=dict(default='present', choices=['present', 'absent']), spot_price=dict(type='float'), - instance_monitoring=dict(default=False, type='bool'), ramdisk_id=dict(type='str'), instance_profile_name=dict(type='str'), ebs_optimized=dict(default=False, type='bool'), associate_public_ip_address=dict(type='bool'), + instance_monitoring=dict(default=False, type='bool'), ) )