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
bc80bd36
Commit
bc80bd36
authored
Jun 14, 2015
by
Victor Schröder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds the necessary logic to ec2.py to load ElastiCache related configuration
parent
382c6fe0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
plugins/inventory/ec2.py
+21
-0
No files found.
plugins/inventory/ec2.py
View file @
bc80bd36
...
...
@@ -121,6 +121,7 @@ from time import time
import
boto
from
boto
import
ec2
from
boto
import
rds
from
boto
import
elasticache
from
boto
import
route53
import
six
...
...
@@ -232,6 +233,11 @@ class Ec2Inventory(object):
if
config
.
has_option
(
'ec2'
,
'rds'
):
self
.
rds_enabled
=
config
.
getboolean
(
'ec2'
,
'rds'
)
# Include ElastiCache instances?
self
.
elasticache_enabled
=
True
if
config
.
has_option
(
'ec2'
,
'elasticache'
):
self
.
elasticache_enabled
=
config
.
getboolean
(
'ec2'
,
'elasticache'
)
# Return all EC2 and RDS instances (if RDS is enabled)
if
config
.
has_option
(
'ec2'
,
'all_instances'
):
self
.
all_instances
=
config
.
getboolean
(
'ec2'
,
'all_instances'
)
...
...
@@ -242,6 +248,18 @@ class Ec2Inventory(object):
else
:
self
.
all_rds_instances
=
False
# Return all ElastiCache clusters? (if ElastiCache is enabled)
if
config
.
has_option
(
'ec2'
,
'all_elasticache_clusters'
)
and
self
.
elasticache_enabled
:
self
.
all_elasticache_clusters
=
config
.
getboolean
(
'ec2'
,
'all_elasticache_clusters'
)
else
:
self
.
all_elasticache_clusters
=
False
# Return all ElastiCache nodes? (if ElastiCache is enabled)
if
config
.
has_option
(
'ec2'
,
'all_elasticache_nodes'
)
and
self
.
elasticache_enabled
:
self
.
all_elasticache_nodes
=
config
.
getboolean
(
'ec2'
,
'all_elasticache_nodes'
)
else
:
self
.
all_elasticache_nodes
=
False
# Cache related
cache_dir
=
os
.
path
.
expanduser
(
config
.
get
(
'ec2'
,
'cache_path'
))
if
not
os
.
path
.
exists
(
cache_dir
):
...
...
@@ -272,6 +290,9 @@ class Ec2Inventory(object):
'group_by_route53_names'
,
'group_by_rds_engine'
,
'group_by_rds_parameter_group'
,
'group_by_elasticache_engine'
,
'group_by_elasticache_cluster'
,
'group_by_elasticache_parameter_group'
,
]
for
option
in
group_by_options
:
if
config
.
has_option
(
'ec2'
,
option
):
...
...
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