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

Support for user_data in ec2 module #1638

Merged
merged 1 commit into from
Nov 17, 2012
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
13 changes: 11 additions & 2 deletions library/ec2
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ options:
required: False
default: null
aliases: []

user_data:
version_added: "0.9"
description:
- opaque blob of data which is made available to the ec2 instance
required: False
default: null
aliases: []
examples:
- code: "local_action: ec2 keypair=admin instance_type=m1.large image=emi-40603AD1 wait=true group=webserver"
description: "Examples from Ansible Playbooks"
Expand Down Expand Up @@ -115,6 +121,7 @@ def main():
ec2_url = dict(aliases=['EC2_URL']),
ec2_secret_key = dict(aliases=['EC2_SECRET_KEY']),
ec2_access_key = dict(aliases=['EC2_ACCESS_KEY']),
user_data = dict(),
)
)

Expand All @@ -129,6 +136,7 @@ def main():
ec2_url = module.params.get('ec2_url')
ec2_secret_key = module.params.get('ec2_secret_key')
ec2_access_key = module.params.get('ec2_access_key')
user_data = module.params.get('user_data')

if ec2_url:
os.environ['EC2_URL'] = ec2_url
Expand All @@ -151,7 +159,8 @@ def main():
security_groups=[group],
instance_type=instance_type,
kernel_id=kernel,
ramdisk_id=ramdisk)
ramdisk_id=ramdisk,
user_data=user_data)

instids = [ i.id for i in res.instances ]

Expand Down