Skip to content

Commit

Permalink
Support for user_data in ec2 module
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
jpmens committed Nov 17, 2012
1 parent 7098181 commit e4606d5
Showing 1 changed file with 11 additions and 2 deletions.
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

0 comments on commit e4606d5

Please sign in to comment.