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
9aacecd3
Commit
9aacecd3
authored
Oct 04, 2013
by
Chris Church
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow specifying an alternate ec2.ini path via EC2_INI_PATH environment variable.
parent
1688139c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
plugins/inventory/ec2.py
+8
-1
No files found.
plugins/inventory/ec2.py
View file @
9aacecd3
...
...
@@ -12,6 +12,11 @@ variables needed for Boto have already been set:
export AWS_ACCESS_KEY_ID='AK123'
export AWS_SECRET_ACCESS_KEY='abc123'
This script also assumes there is an ec2.ini file alongside it. To specify a
different path to ec2.ini, define the EC2_INI_PATH environment variable:
export EC2_INI_PATH=/path/to/my_ec2.ini
If you're using eucalyptus you need to set the above variables and
you need to define:
...
...
@@ -177,7 +182,9 @@ class Ec2Inventory(object):
''' Reads the settings from the ec2.ini file '''
config
=
ConfigParser
.
SafeConfigParser
()
config
.
read
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
'/ec2.ini'
)
ec2_default_ini_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
'ec2.ini'
)
ec2_ini_path
=
os
.
environ
.
get
(
'EC2_INI_PATH'
,
ec2_default_ini_path
)
config
.
read
(
ec2_ini_path
)
# is eucalyptus?
self
.
eucalyptus_host
=
None
...
...
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