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
fd7e96d3
Commit
fd7e96d3
authored
Jul 11, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #578 from jeremysmitherman/boolean_parameters
Removed boolean parameter setting from user module.
parents
626e4cb0
ecacb67d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
library/user
+8
-4
No files found.
library/user
View file @
fd7e96d3
...
@@ -70,9 +70,9 @@ def add_user_info(kwargs):
...
@@ -70,9 +70,9 @@ def add_user_info(kwargs):
def
user_del
(
user
,
**
kwargs
):
def
user_del
(
user
,
**
kwargs
):
cmd
=
[
USERDEL
]
cmd
=
[
USERDEL
]
for
key
in
kwargs
:
for
key
in
kwargs
:
if
key
==
'force'
and
kwargs
[
key
]:
if
key
==
'force'
and
kwargs
[
key
]
==
'yes'
:
cmd
.
append
(
'-f'
)
cmd
.
append
(
'-f'
)
elif
key
==
'remove'
and
kwargs
[
key
]:
elif
key
==
'remove'
and
kwargs
[
key
]
==
'yes'
:
cmd
.
append
(
'-r'
)
cmd
.
append
(
'-r'
)
cmd
.
append
(
user
)
cmd
.
append
(
user
)
p
=
subprocess
.
Popen
(
cmd
,
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
p
=
subprocess
.
Popen
(
cmd
,
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
...
@@ -287,8 +287,8 @@ password = params.get('password', None)
...
@@ -287,8 +287,8 @@ password = params.get('password', None)
# ===========================================
# ===========================================
# following options are specific to userdel
# following options are specific to userdel
force
=
params
.
get
(
'force'
,
False
)
force
=
params
.
get
(
'force'
,
'no'
)
remove
=
params
.
get
(
'remove'
,
False
)
remove
=
params
.
get
(
'remove'
,
'no'
)
# ===========================================
# ===========================================
# following options are specific to useradd
# following options are specific to useradd
...
@@ -307,6 +307,10 @@ if system not in ['yes', 'no']:
...
@@ -307,6 +307,10 @@ if system not in ['yes', 'no']:
fail_json
(
msg
=
'invalid system'
)
fail_json
(
msg
=
'invalid system'
)
if
append
not
in
[
'yes'
,
'no'
]:
if
append
not
in
[
'yes'
,
'no'
]:
fail_json
(
msg
=
'invalid append'
)
fail_json
(
msg
=
'invalid append'
)
if
force
not
in
[
'yes'
,
'no'
]:
fail_json
(
msg
=
"invalid option for force, requires yes or no (defaults to no)"
)
if
remove
not
in
[
'yes'
,
'no'
]:
fail_json
(
msg
=
"invalid option for remove, requires yes or no (defaults to no)"
)
if
name
is
None
:
if
name
is
None
:
fail_json
(
msg
=
'name is required'
)
fail_json
(
msg
=
'name is required'
)
...
...
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