From f79cd6c846d8e2967b32e85eb510e90e074f8732 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 27 Oct 2017 12:16:21 -0400 Subject: [PATCH] adjust nohome param when using luser fixes #32199 (cherry picked from commit bd321a0af63f85bbb173a04801ac78924d29fdf7) --- CHANGELOG.md | 2 ++ lib/ansible/modules/system/user.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cede27ce04..d83fcfd8b42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,8 @@ Ansible Changes By Release https://github.com/ansible/ansible/pull/32269 * Fix vars placement in ansible-inventory https://github.com/ansible/ansible/pull/32276 +* Correct options for luseradd in user module + https://github.com/ansible/ansible/pull/32262 diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index af7e3147e52..b1f1f46930a 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -421,6 +421,10 @@ class User(object): if self.createhome: cmd.append('-m') + if self.local: + cmd.append('-M') + else: + cmd.append('-m') if self.skeleton is not None: cmd.append('-k')