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
456d2627
Commit
456d2627
authored
Mar 27, 2014
by
Ingmar Hupp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EC2 inventory toggle to exclude/include RDS instances.
parent
1faa840b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
plugins/inventory/ec2.ini
+3
-0
plugins/inventory/ec2.py
+4
-0
No files found.
plugins/inventory/ec2.ini
View file @
456d2627
...
...
@@ -38,6 +38,9 @@ vpc_destination_variable = ip_address
# Route53, uncomment and set 'route53' to True.
route53
=
False
# To include RDS instances in inventory, set to True.
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 @
456d2627
...
...
@@ -222,6 +222,9 @@ class Ec2Inventory(object):
self
.
route53_excluded_zones
.
extend
(
config
.
get
(
'ec2'
,
'route53_excluded_zones'
,
''
)
.
split
(
','
))
# RDS
self
.
rds_enabled
=
config
.
getboolean
(
'ec2'
,
'rds'
)
# Cache related
cache_dir
=
os
.
path
.
expanduser
(
config
.
get
(
'ec2'
,
'cache_path'
))
if
not
os
.
path
.
exists
(
cache_dir
):
...
...
@@ -254,6 +257,7 @@ class Ec2Inventory(object):
for
region
in
self
.
regions
:
self
.
get_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
)
...
...
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