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
e64daba8
Commit
e64daba8
authored
Jun 14, 2015
by
Victor Schröder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a flag (is_redis) to prevent duplicity of information about Redis single node clusters
parent
2a242a0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
plugins/inventory/ec2.py
+9
-5
No files found.
plugins/inventory/ec2.py
View file @
e64daba8
...
...
@@ -702,9 +702,13 @@ class Ec2Inventory(object):
if
'ConfigurationEndpoint'
in
cluster
and
cluster
[
'ConfigurationEndpoint'
]:
# Memcached cluster
dest
=
cluster
[
'ConfigurationEndpoint'
][
'Address'
]
is_redis
=
False
else
:
# Redis sigle node cluster
# Because all Redis clusters are single nodes, we'll merge the
# info from the cluster with info about the node
dest
=
cluster
[
'CacheNodes'
][
0
][
'Endpoint'
][
'Address'
]
is_redis
=
True
if
not
dest
:
# Skip clusters we cannot address (e.g. private VPC subnet)
...
...
@@ -720,13 +724,13 @@ class Ec2Inventory(object):
self
.
push_group
(
self
.
inventory
,
'instances'
,
cluster
[
'CacheClusterId'
])
# Inventory: Group by region
if
self
.
group_by_region
:
if
self
.
group_by_region
and
not
is_redis
:
self
.
push
(
self
.
inventory
,
region
,
dest
)
if
self
.
nested_groups
:
self
.
push_group
(
self
.
inventory
,
'regions'
,
region
)
# Inventory: Group by availability zone
if
self
.
group_by_availability_zone
:
if
self
.
group_by_availability_zone
and
not
is_redis
:
self
.
push
(
self
.
inventory
,
cluster
[
'PreferredAvailabilityZone'
],
dest
)
if
self
.
nested_groups
:
if
self
.
group_by_region
:
...
...
@@ -734,7 +738,7 @@ class Ec2Inventory(object):
self
.
push_group
(
self
.
inventory
,
'zones'
,
cluster
[
'PreferredAvailabilityZone'
])
# Inventory: Group by node type
if
self
.
group_by_instance_type
:
if
self
.
group_by_instance_type
and
not
is_redis
:
type_name
=
self
.
to_safe
(
'type_'
+
cluster
[
'CacheNodeType'
])
self
.
push
(
self
.
inventory
,
type_name
,
dest
)
if
self
.
nested_groups
:
...
...
@@ -748,7 +752,7 @@ class Ec2Inventory(object):
# self.push_group(self.inventory, 'vpcs', vpc_id_name)
# Inventory: Group by security group
if
self
.
group_by_security_group
:
if
self
.
group_by_security_group
and
not
is_redis
:
if
'SecurityGroups'
in
cluster
:
for
security_group
in
cluster
[
'SecurityGroups'
]:
key
=
self
.
to_safe
(
"security_group_"
+
security_group
[
'SecurityGroupId'
])
...
...
@@ -757,7 +761,7 @@ class Ec2Inventory(object):
self
.
push_group
(
self
.
inventory
,
'security_groups'
,
key
)
# Inventory: Group by engine
if
self
.
group_by_elasticache_engine
:
if
self
.
group_by_elasticache_engine
and
not
is_redis
:
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
"elasticache_"
+
cluster
[
'Engine'
]),
dest
)
if
self
.
nested_groups
:
self
.
push_group
(
self
.
inventory
,
'elasticache_engines'
,
self
.
to_safe
(
cluster
[
'Engine'
]))
...
...
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