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
0ae87cb7
Commit
0ae87cb7
authored
Jul 31, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ec2inv-rdstoggle' of
https://github.com/ingmar/ansible
into ingmar-ec2inv-rdstoggle
Conflicts: plugins/inventory/ec2.py
parents
c0455dc7
cc01f7b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
plugins/inventory/ec2.ini
+3
-0
plugins/inventory/ec2.py
+9
-3
No files found.
plugins/inventory/ec2.ini
View file @
0ae87cb7
...
...
@@ -38,6 +38,9 @@ vpc_destination_variable = ip_address
# Route53, uncomment and set 'route53' to True.
route53
=
False
# To exclude RDS instances from the inventory, uncomment and set to False.
#rds = False
# Additionally, you can specify the list of zones to exclude looking up in
# 'route53_excluded_zones' as a comma-separated list.
# route53_excluded_zones = samplezone1.com, samplezone2.com
...
...
plugins/inventory/ec2.py
View file @
0ae87cb7
...
...
@@ -222,12 +222,17 @@ class Ec2Inventory(object):
self
.
route53_excluded_zones
.
extend
(
config
.
get
(
'ec2'
,
'route53_excluded_zones'
,
''
)
.
split
(
','
))
# Return all EC2/RDS instances
# Include RDS instances?
self
.
rds_enabled
=
True
if
config
.
has_option
(
'ec2'
,
'rds'
):
self
.
rds_enabled
=
config
.
getboolean
(
'ec2'
,
'rds'
)
# 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'
)
else
:
self
.
all_instances
=
False
if
config
.
has_option
(
'ec2'
,
'all_rds_instances'
):
if
config
.
has_option
(
'ec2'
,
'all_rds_instances'
)
and
self
.
rds_enabled
:
self
.
all_rds_instances
=
config
.
getboolean
(
'ec2'
,
'all_rds_instances'
)
else
:
self
.
all_rds_instances
=
False
...
...
@@ -268,7 +273,8 @@ class Ec2Inventory(object):
for
region
in
self
.
regions
:
self
.
get_instances_by_region
(
region
)
self
.
get_rds_instances_by_region
(
region
)
if
self
.
rds_enabled
:
self
.
get_rds_instances_by_region
(
region
)
self
.
write_to_cache
(
self
.
inventory
,
self
.
cache_path_cache
)
self
.
write_to_cache
(
self
.
index
,
self
.
cache_path_index
)
...
...
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