diff --git a/changelogs/fragments/user-freebsd-createhome-name-fix.yaml b/changelogs/fragments/user-freebsd-createhome-name-fix.yaml new file mode 100644 index 0000000000..dc379659af --- /dev/null +++ b/changelogs/fragments/user-freebsd-createhome-name-fix.yaml @@ -0,0 +1,2 @@ +bugfixes: + - user - use correct attribute name in FreeBSD for creat_home (https://github.com/ansible/ansible/pull/42711) diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index 78f3d89c16..032d72bc7e 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -1008,7 +1008,7 @@ class FreeBsdUser(User): cmd.append(self.comment) if self.home is not None: - if (info[5] != self.home and self.move_home) or (not os.path.exists(self.home) and self.createhome): + if (info[5] != self.home and self.move_home) or (not os.path.exists(self.home) and self.create_home): cmd.append('-m') cmd.append('-d') cmd.append(self.home)