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
f905e751
Commit
f905e751
authored
Nov 04, 2012
by
Nigel Metheringham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FreeBSD user mod only fires when there are changes
Also fix missing -G on groups change
parent
1ab1c8d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
library/user
+6
-1
No files found.
library/user
View file @
f905e751
...
...
@@ -568,6 +568,7 @@ class FreeBsdUser(User):
'usermod'
,
'-n'
,
self
.
name
]
cmd_len
=
len
(
cmd
)
info
=
self
.
user_info
()
if
self
.
uid
is
not
None
and
info
[
2
]
!=
int
(
self
.
uid
):
...
...
@@ -614,15 +615,19 @@ class FreeBsdUser(User):
groups_need_mod
=
True
if
groups_need_mod
:
cmd
.
append
(
'-G'
)
new_groups
=
groups
if
self
.
append
:
new_groups
.
append
(
current_groups
)
cmd
.
append
(
','
.
join
(
new_groups
))
# modify the user
# modify the user if cmd will do anything
if
cmd_len
!=
len
(
cmd
):
(
rc
,
out
,
err
)
=
self
.
execute_command
(
cmd
)
if
rc
is
not
None
and
rc
!=
0
:
module
.
fail_json
(
name
=
self
.
name
,
msg
=
err
,
rc
=
rc
)
else
:
(
rc
,
out
,
err
)
=
(
None
,
''
,
''
)
# we have to set the password in a second command
if
self
.
password
is
not
None
and
info
[
1
]
!=
self
.
password
:
...
...
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