From 8ae0079ef71fcd822795b38dfabe20473145943e Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Tue, 31 Oct 2017 14:37:22 -0700 Subject: [PATCH] luseradd defaults to creating w/o need for -m (#32411) and -M is incorrect in this case (cherry picked from commit 3e80f9caf46e0e314ee60a0bef0701ba23ed952c) --- CHANGELOG.md | 2 ++ lib/ansible/modules/system/user.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d505aec7a6..8c6851f5f77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,6 +102,8 @@ Ansible Changes By Release https://github.com/ansible/ansible/pull/32262 * Clarified package docs on 'latest' state https://github.com/ansible/ansible/pull/32397 +* Fix issue with user module when local is true + (https://github.com/ansible/ansible/pull/32262 and https://github.com/ansible/ansible/pull/32411) diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index b1f1f46930a..1f1677405e2 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -420,10 +420,7 @@ class User(object): cmd.append(self.password) if self.createhome: - cmd.append('-m') - if self.local: - cmd.append('-M') - else: + if not self.local: cmd.append('-m') if self.skeleton is not None: