Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds private_ip param to ec2 module #2550

Merged
merged 1 commit into from
Apr 5, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions library/ec2
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ options:
required: false
default: null
aliases: []
private_ip:
version_added: "?.?"
description:
- the private ip address to assign the instance (from the vpc subnet)
required: false
defualt: null
aliases: []

examples:
- code: 'local_action: ec2 keypair=admin instance_type=m1.large image=emi-40603AD1 wait=yes group=webserver count=3 group=webservers'
description: "Examples from Ansible Playbooks"
Expand Down Expand Up @@ -172,6 +180,7 @@ def main():
user_data = dict(),
instance_tags = dict(),
vpc_subnet_id = dict(),
private_ip = dict(),
)
)

Expand All @@ -193,6 +202,7 @@ def main():
user_data = module.params.get('user_data')
instance_tags = module.params.get('instance_tags')
vpc_subnet_id = module.params.get('vpc_subnet_id')
private_ip = module.params.get('private_ip')

# allow eucarc environment variables to be used if ansible vars aren't set
if not ec2_url and 'EC2_URL' in os.environ:
Expand Down Expand Up @@ -250,6 +260,7 @@ def main():
kernel_id = kernel,
ramdisk_id = ramdisk,
subnet_id = vpc_subnet_id,
private_ip_address = private_ip,
user_data = user_data)
except boto.exception.BotoServerError, e:
module.fail_json(msg = "%s: %s" % (e.error_code, e.error_message))
Expand Down