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
139aee58
Commit
139aee58
authored
Jan 22, 2013
by
Tim Gerla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use connect_ec2_endpoint instead of connect_euca, and properly pass keys to connect_ec2
parent
456e6f5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
library/ec2
+3
-9
No files found.
library/ec2
View file @
139aee58
...
...
@@ -98,7 +98,6 @@ author: Seth Vidal
import
boto
import
time
from
urlparse
import
urlparse
def
main
():
module
=
AnsibleModule
(
...
...
@@ -139,15 +138,10 @@ def main():
if
not
ec2_access_key
and
'EC2_ACCESS_KEY'
in
os
.
environ
:
ec2_access_key
=
os
.
environ
[
'EC2_ACCESS_KEY'
]
if
ec2_url
:
# if we have an URL set, assume Eucalyptus
url
=
urlparse
(
ec2_url
)
ec2
=
boto
.
connect_euca
(
host
=
url
.
netloc
.
split
(
":"
)[
0
],
aws_access_key_id
=
ec2_access_key
,
aws_secret_access_key
=
ec2_secret_key
,
port
=
url
.
port
,
path
=
url
.
path
)
if
ec2_url
:
# if we have an URL set, connect to the specified endpoint
ec2
=
boto
.
connect_ec2_endpoint
(
ec2_url
,
ec2_access_key
,
ec2_secret_key
)
else
:
# otherwise it's Amazon.
ec2
=
boto
.
connect_ec2
()
ec2
=
boto
.
connect_ec2
(
ec2_access_key
,
ec2_secret_key
)
try
:
res
=
ec2
.
run_instances
(
image
,
key_name
=
key_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