saltstack/salt — Issue #728: user state not creating home folder on FreeBSD
Author: cedwards
Created: 2012-02-21 17:34:55+00:00
State: open

The state module is not creating home folders for new users on FreeBSD. Below I've included the state file I'm using, and then reproduced the steps to repeat. Please let me know if you have any questions.

cedwards:
user:
- present
- uid: 1001
group:
- present
- gid: 1001
- require:
- user: cedwards

[root@yankee ~]# id cedwards
id: cedwards: no such user

[root@yankee ~]# salt-call state.highstate
[INFO ] Loading fresh modules for state activity
[INFO ] Loading fresh modules for state activity
[INFO ] Executing state file.managed for /etc/hosts
[INFO ] No changes made for /etc/hosts
[INFO ] Executing state file.managed for /etc/localtime
[INFO ] No changes made for /etc/localtime
[INFO ] Executing state file.managed for /etc/make.conf
[INFO ] No changes made for /etc/make.conf
[INFO ] Executing state file.managed for /etc/resolv.conf
[INFO ] No changes made for /etc/resolv.conf
[INFO ] Executing state file.managed for /root/.bash_profile
[INFO ] No changes made for /root/.bash_profile
[INFO ] Executing state file.managed for /root/.bashrc
[INFO ] No changes made for /root/.bashrc
[INFO ] Executing state file.managed for /root/.vimrc
[INFO ] No changes made for /root/.vimrc
[INFO ] Executing state file.managed for /usr/local/etc/buildflags.conf
[INFO ] No changes made for /usr/local/etc/buildflags.conf
[INFO ] Executing state file.managed for /usr/local/etc/salt/minion
[INFO ] No changes made for /usr/local/etc/salt/minion
[INFO ] Executing state user.present for cedwards
[INFO ] Executing command pw useradd -s /bin/bash -u 1001 -n cedwards in directory /root
[INFO ] stdout:
[INFO ] stderr:
[INFO ] {'shell': '/bin/bash', 'name': 'cedwards', 'passwd': '*', 'gid': 1001, 'groups': [], 'home': '/home/cedwards', 'uid': 1001}
[INFO ] Executing state group.present for cedwards
[INFO ] No changes made for cedwards
[INFO ] Executing state pkg.installed for bash
[INFO ] Executing command pkg_info in directory /root
[INFO ] No changes made for bash
[INFO ] Loading fresh modules for state activity
[INFO ] Executing state pkg.installed for bsdadminscripts
[INFO ] Executing command pkg_info in directory /root
[INFO ] No changes made for bsdadminscripts
[INFO ] Loading fresh modules for state activity
[INFO ] Executing state pkg.installed for ccache
[INFO ] Executing command pkg_info in directory /root
[INFO ] No changes made for ccache
[INFO ] Loading fresh modules for state activity
[INFO ] Executing state pkg.installed for salt
[INFO ] Executing command pkg_info in directory /root
[INFO ] No changes made for salt
[INFO ] Loading fresh modules for state activity
[INFO ] Executing state pkg.installed for vim-lite
[INFO ] Executing command pkg_info in directory /root
[INFO ] No changes made for vim-lite
[INFO ] Loading fresh modules for state activity
[INFO ] Executing state service.running for salt-minion
[INFO ] Executing command ps auxwww | grep salt-minion | grep -v grep | awk '{print $2}' in directory /root
[INFO ] No changes made for salt-minion
local:
----------
State: - user
Name: cedwards
Function: present
Result: True
Comment: New user cedwards created
Changes: shell: /bin/bash
name: cedwards
passwd: *
gid: 1001
groups: []
home: /home/cedwards
uid: 1001

[root@yankee ~]# id cedwards
uid=1001(cedwards) gid=1001(cedwards) groups=1001(cedwards)

[root@yankee ~]# getent passwd cedwards
cedwards:*:1001:1001:User &:/home/cedwards:/bin/bash

[root@yankee ~]# ls -hal /home/cedwards
ls: /home/cedwards: No such file or directory