summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaksekine <t-sekine@ce.jp.nec.com>2017-05-12 05:59:39 +0900
committerMatt Davis <nitzmahone@users.noreply.github.com>2017-05-11 13:59:39 -0700
commitb04df23da2f35197f6b94aada9831602c0c8aad7 (patch)
tree987b2f17e7bd2f0663444bb1835e5aee54bf5bd0
parentc50cf22d521d4d2efcdf45283f868f035ff44cef (diff)
downloadansible-b04df23da2f35197f6b94aada9831602c0c8aad7.tar.gz
fix #24429 (#24491)
-rw-r--r--lib/ansible/modules/system/user.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py
index fb0754183d..4b73057934 100644
--- a/lib/ansible/modules/system/user.py
+++ b/lib/ansible/modules/system/user.py
@@ -2068,20 +2068,17 @@ class HPUX(User):
if self.append:
for g in groups:
if g in group_diff:
- if has_append:
- cmd.append('-a')
groups_need_mod = True
break
else:
groups_need_mod = True
if groups_need_mod:
- if self.append and not has_append:
- cmd.append('-A')
- cmd.append(','.join(group_diff))
- else:
- cmd.append('-G')
- cmd.append(','.join(groups))
+ cmd.append('-G')
+ new_groups = groups
+ if self.append:
+ new_groups = groups | set(current_groups)
+ cmd.append(','.join(new_groups))
if self.comment is not None and info[4] != self.comment: