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
1529a974
Commit
1529a974
authored
Jul 22, 2013
by
Ralph Tice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed vpc provisioning / clarified group_id usage
parent
86f05f11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
library/cloud/ec2
+6
-3
No files found.
library/cloud/ec2
View file @
1529a974
...
...
@@ -43,7 +43,7 @@ options:
group_id:
version_added: "1.1"
description:
- security group id to use with the instance
- security group id
(or list of ids)
to use with the instance
required: false
default: null
aliases: []
...
...
@@ -232,7 +232,7 @@ local_action:
instance_type: m1.small
image: ami-6e649707
wait: yes
vpc_subnet_id: subnet-29e63245
'
vpc_subnet_id: subnet-29e63245
# Launch instances, runs some tasks
...
...
@@ -354,7 +354,7 @@ def create_instances(module, ec2):
instance_profile_name
=
module
.
params
.
get
(
'instance_profile_name'
)
#
Here we try to lookup the group name from the security group id - if group_id is set.
#
group_id and group_name are exclusive of each other
if
group_id
and
group_name
:
module
.
fail_json
(
msg
=
str
(
"Use only one type of parameter (group_name) or (group_id)"
))
sys
.
exit
(
1
)
...
...
@@ -372,6 +372,9 @@ def create_instances(module, ec2):
group_name
=
[
group_name
]
# Now we try to lookup the group id testing if group exists.
elif
group_id
:
#wrap the group_id in a list if it's not one already
if
type
(
group_id
)
==
str
:
group_id
=
[
group_id
]
grp_details
=
ec2
.
get_all_security_groups
(
group_ids
=
group_id
)
grp_item
=
grp_details
[
0
]
group_name
=
[
grp_item
.
name
]
...
...
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