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
cdc34477
Commit
cdc34477
authored
Jan 29, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of
https://github.com/aclindsa/ansible
into aclindsa-devel
parents
c997f03b
59ac969d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
library/system/user
+17
-0
No files found.
library/system/user
View file @
cdc34477
...
@@ -94,6 +94,14 @@ options:
...
@@ -94,6 +94,14 @@ options:
- Unless set to C(no), a home directory will be made for the user
- Unless set to C(no), a home directory will be made for the user
when the account is created or if the home directory does not
when the account is created or if the home directory does not
exist.
exist.
move_home:
required: false
default: "no"
choices: [ "yes", "no" ]
description:
- If set to C(yes) when used with C(home=), attempt to move the
user's home directory to the specified directory if it isn't there
already.
system:
system:
required: false
required: false
default: "no"
default: "no"
...
@@ -231,6 +239,7 @@ class User(object):
...
@@ -231,6 +239,7 @@ class User(object):
self
.
force
=
module
.
params
[
'force'
]
self
.
force
=
module
.
params
[
'force'
]
self
.
remove
=
module
.
params
[
'remove'
]
self
.
remove
=
module
.
params
[
'remove'
]
self
.
createhome
=
module
.
params
[
'createhome'
]
self
.
createhome
=
module
.
params
[
'createhome'
]
self
.
move_home
=
module
.
params
[
'move_home'
]
self
.
system
=
module
.
params
[
'system'
]
self
.
system
=
module
.
params
[
'system'
]
self
.
login_class
=
module
.
params
[
'login_class'
]
self
.
login_class
=
module
.
params
[
'login_class'
]
self
.
append
=
module
.
params
[
'append'
]
self
.
append
=
module
.
params
[
'append'
]
...
@@ -389,6 +398,7 @@ class User(object):
...
@@ -389,6 +398,7 @@ class User(object):
cmd
.
append
(
self
.
comment
)
cmd
.
append
(
self
.
comment
)
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
move_home
:
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
self
.
home
)
cmd
.
append
(
self
.
home
)
...
@@ -705,6 +715,7 @@ class FreeBsdUser(User):
...
@@ -705,6 +715,7 @@ class FreeBsdUser(User):
cmd
.
append
(
self
.
comment
)
cmd
.
append
(
self
.
comment
)
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
move_home
:
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
self
.
home
)
cmd
.
append
(
self
.
home
)
...
@@ -892,6 +903,7 @@ class OpenBSDUser(User):
...
@@ -892,6 +903,7 @@ class OpenBSDUser(User):
cmd
.
append
(
self
.
comment
)
cmd
.
append
(
self
.
comment
)
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
move_home
:
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
self
.
home
)
cmd
.
append
(
self
.
home
)
...
@@ -1059,6 +1071,7 @@ class NetBSDUser(User):
...
@@ -1059,6 +1071,7 @@ class NetBSDUser(User):
cmd
.
append
(
self
.
comment
)
cmd
.
append
(
self
.
comment
)
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
move_home
:
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
self
.
home
)
cmd
.
append
(
self
.
home
)
...
@@ -1222,6 +1235,7 @@ class SunOS(User):
...
@@ -1222,6 +1235,7 @@ class SunOS(User):
cmd
.
append
(
self
.
comment
)
cmd
.
append
(
self
.
comment
)
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
move_home
:
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
self
.
home
)
cmd
.
append
(
self
.
home
)
...
@@ -1378,6 +1392,7 @@ class AIX(User):
...
@@ -1378,6 +1392,7 @@ class AIX(User):
cmd
.
append
(
self
.
comment
)
cmd
.
append
(
self
.
comment
)
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
home
is
not
None
and
info
[
5
]
!=
self
.
home
:
if
self
.
move_home
:
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-m'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
'-d'
)
cmd
.
append
(
self
.
home
)
cmd
.
append
(
self
.
home
)
...
@@ -1441,6 +1456,7 @@ def main():
...
@@ -1441,6 +1456,7 @@ def main():
createhome
=
dict
(
default
=
'yes'
,
type
=
'bool'
),
createhome
=
dict
(
default
=
'yes'
,
type
=
'bool'
),
system
=
dict
(
default
=
'no'
,
type
=
'bool'
),
system
=
dict
(
default
=
'no'
,
type
=
'bool'
),
# following options are specific to usermod
# following options are specific to usermod
move_home
=
dict
(
default
=
'no'
,
type
=
'bool'
),
append
=
dict
(
default
=
'no'
,
type
=
'bool'
),
append
=
dict
(
default
=
'no'
,
type
=
'bool'
),
# following are specific to ssh key generation
# following are specific to ssh key generation
generate_ssh_key
=
dict
(
type
=
'bool'
),
generate_ssh_key
=
dict
(
type
=
'bool'
),
...
@@ -1488,6 +1504,7 @@ def main():
...
@@ -1488,6 +1504,7 @@ def main():
# modify user (note: this function is check mode aware)
# modify user (note: this function is check mode aware)
(
rc
,
out
,
err
)
=
user
.
modify_user
()
(
rc
,
out
,
err
)
=
user
.
modify_user
()
result
[
'append'
]
=
user
.
append
result
[
'append'
]
=
user
.
append
result
[
'move_home'
]
=
user
.
move_home
if
rc
is
not
None
and
rc
!=
0
:
if
rc
is
not
None
and
rc
!=
0
:
module
.
fail_json
(
name
=
user
.
name
,
msg
=
err
,
rc
=
rc
)
module
.
fail_json
(
name
=
user
.
name
,
msg
=
err
,
rc
=
rc
)
if
user
.
password
is
not
None
:
if
user
.
password
is
not
None
:
...
...
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