diff --git a/library/cloud/ec2_lc b/library/cloud/ec2_lc index 2fe0e471f6..a90a592f90 100755 --- a/library/cloud/ec2_lc +++ b/library/cloud/ec2_lc @@ -79,6 +79,13 @@ options: required: false default: false aliases: [] + assign_public_ip: + description: + - whether instances in group are launched with a public IP. + required: false + default: false + aliases: [] + version_added: "1.8" extends_documentation_fragment: aws """ @@ -139,6 +146,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') + assign_public_ip = module.params.get('assign_public_ip') bdm = BlockDeviceMapping() if volumes: @@ -159,7 +167,8 @@ def create_launch_config(connection, module): block_device_mappings=[bdm], instance_type=instance_type, spot_price=spot_price, - instance_monitoring=instance_monitoring) + instance_monitoring=instance_monitoring, + associate_public_ip_address = assign_public_ip ) launch_configs = connection.get_all_launch_configurations(names=[name]) changed = False @@ -201,6 +210,7 @@ def main(): state=dict(default='present', choices=['present', 'absent']), spot_price=dict(type='float'), instance_monitoring=dict(default=False, type='bool'), + assign_public_ip=dict(default=False, type='bool') ) )