Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
edx
configuration
Commits
68242c5b
Commit
68242c5b
authored
Nov 06, 2015
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review comments.
parent
de7e60c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
playbooks/library/mongo_rs_member
+8
-2
playbooks/library/mongo_status
+1
-1
No files found.
playbooks/library/mongo_rs_member
View file @
68242c5b
...
...
@@ -48,8 +48,12 @@ options:
required: false
state:
description:
- Whether or not the member exists in the replica set. The member
e
- Whether or not the member exists in the replica set. The member
will be added or removed to reach this state.
choices:
- present
- absent
default: present
required: false
"""
...
...
@@ -121,6 +125,7 @@ def primary_client(module, some_host, some_port, username, password):
# Connect to the primary if this is not the primary.
if
primary_host
!=
some_host
or
primary_port
!=
some_port
:
client
.
close
()
new_uri
=
get_mongo_uri
(
primary_host
,
primary_port
,
username
,
password
)
client
=
MongoClient
(
new_uri
)
...
...
@@ -179,7 +184,8 @@ def upsert_member(module, client, rs_config):
# See if member is already in the replica set
if
new_member_name
in
existing_member_names
:
# Make sure its config is the same.
# Make sure its config is the same. Grab a pointer to the current settings
# inside of the rs_config.
current_settings
=
filter
(
lambda
member
:
member
[
'host'
]
==
new_member_name
,
rs_config
[
'members'
])[
0
]
need_to_update
=
False
...
...
playbooks/library/mongo_status
View file @
68242c5b
...
...
@@ -11,7 +11,7 @@ author: Feanil Patel
options:
host:
description:
- The hostname or ip of a server in the mongo cluster.
It can include a port number.
- The hostname or ip of a server in the mongo cluster.
required: false
default: 'localhost'
port:
...
...
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