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
6a321fe3
Commit
6a321fe3
authored
Apr 05, 2014
by
Cove Schneider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-add idempotency check
parent
6e81f41c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
library/database/mongodb_user
+10
-0
No files found.
library/database/mongodb_user
View file @
6a321fe3
...
...
@@ -48,6 +48,7 @@ options:
required: false
default: 27017
replica_set:
version_added: "1.6"
description:
- Replica set to connect to (automatically connects to primary for writes)
required: false
...
...
@@ -196,6 +197,15 @@ def main():
else
:
client
=
MongoClient
(
login_host
,
int
(
login_port
))
# try to authenticate as a target user to check if it already exists
try
:
client
[
db_name
]
.
authenticate
(
user
,
password
)
if
state
==
'present'
:
module
.
exit_json
(
changed
=
False
,
user
=
user
)
except
OperationFailure
:
if
state
==
'absent'
:
module
.
exit_json
(
changed
=
False
,
user
=
user
)
if
login_user
is
None
and
login_password
is
None
:
mongocnf_creds
=
load_mongocnf
()
if
mongocnf_creds
is
not
False
:
...
...
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