Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
30ac2edc
Commit
30ac2edc
authored
Feb 23, 2013
by
lwade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding VPC subnet ID support
parent
a875b637
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
library/ec2
+10
-0
No files found.
library/ec2
View file @
30ac2edc
...
...
@@ -116,6 +116,13 @@ options:
required: false
default: null
aliases: []
subnet_id:
version_added: "1.1"
description:
- the subnet ID in which to launch the instance (VPC)
required: false
default: null
aliases: []
examples:
- code: 'local_action: ec2 keypair=admin instance_type=m1.large image=emi-40603AD1 wait=true group=webserver count=3 group=webservers'
description: "Examples from Ansible Playbooks"
...
...
@@ -150,6 +157,7 @@ def main():
ec2_access_key
=
dict
(
aliases
=
[
'EC2_ACCESS_KEY'
]),
user_data
=
dict
(),
instance_tags
=
dict
(),
vpc_subnet_id
=
dict
(),
)
)
...
...
@@ -168,6 +176,7 @@ def main():
ec2_access_key
=
module
.
params
.
get
(
'ec2_access_key'
)
user_data
=
module
.
params
.
get
(
'user_data'
)
instance_tags
=
module
.
params
.
get
(
'instance_tags'
)
vpc_subnet_id
=
module
.
params
.
get
(
'vpc_subnet_id'
)
# allow eucarc environment variables to be used if ansible vars aren't set
if
not
ec2_url
and
'EC2_URL'
in
os
.
environ
:
...
...
@@ -206,6 +215,7 @@ def main():
instance_type
=
instance_type
,
kernel_id
=
kernel
,
ramdisk_id
=
ramdisk
,
subnet_id
=
vpc_subnet_id
,
user_data
=
user_data
)
except
boto
.
exception
.
BotoServerError
,
e
:
module
.
fail_json
(
msg
=
"
%
s:
%
s"
%
(
e
.
error_code
,
e
.
error_message
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment