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
36177cc9
Commit
36177cc9
authored
Jul 11, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #573 from sfromm/user
Minor tweak to user module
parents
3235da07
ac3341cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
library/user
+7
-11
No files found.
library/user
View file @
36177cc9
...
@@ -310,20 +310,16 @@ if append not in [ 'yes', 'no' ]:
...
@@ -310,20 +310,16 @@ if append not in [ 'yes', 'no' ]:
if
name
is
None
:
if
name
is
None
:
fail_json
(
msg
=
'name is required'
)
fail_json
(
msg
=
'name is required'
)
result
=
{}
rc
=
None
rc
=
0
out
=
''
out
=
''
err
=
''
err
=
''
result
=
{}
result
[
'name'
]
=
name
result
[
'name'
]
=
name
if
state
==
'absent'
:
if
state
==
'absent'
:
if
not
user_exists
(
name
):
if
user_exists
(
name
):
result
[
'changed'
]
=
False
else
:
(
rc
,
out
,
err
)
=
user_del
(
name
,
force
=
force
,
remove
=
remove
)
(
rc
,
out
,
err
)
=
user_del
(
name
,
force
=
force
,
remove
=
remove
)
if
rc
!=
0
:
if
rc
!=
0
:
fail_json
(
name
=
name
,
msg
=
err
)
fail_json
(
name
=
name
,
msg
=
err
)
else
:
result
[
'changed'
]
=
True
result
[
'force'
]
=
force
result
[
'force'
]
=
force
result
[
'remove'
]
=
remove
result
[
'remove'
]
=
remove
elif
state
==
'present'
:
elif
state
==
'present'
:
...
@@ -338,13 +334,13 @@ elif state == 'present':
...
@@ -338,13 +334,13 @@ elif state == 'present':
password
=
password
,
append
=
append
)
password
=
password
,
append
=
append
)
if
rc
is
not
None
and
rc
!=
0
:
if
rc
is
not
None
and
rc
!=
0
:
fail_json
(
name
=
name
,
msg
=
err
)
fail_json
(
name
=
name
,
msg
=
err
)
if
rc
is
None
:
result
[
'changed'
]
=
False
else
:
result
[
'changed'
]
=
True
if
password
is
not
None
:
if
password
is
not
None
:
result
[
'password'
]
=
'NOTLOGGINGPASSWORD'
result
[
'password'
]
=
'NOTLOGGINGPASSWORD'
if
rc
is
None
:
result
[
'changed'
]
=
False
else
:
result
[
'changed'
]
=
True
if
out
:
if
out
:
result
[
'stdout'
]
=
out
result
[
'stdout'
]
=
out
if
err
:
if
err
:
...
...
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