chef: user resource "manage_home" doesn't create home directory for an existing user in CentOS 6

Description

The user resource’s manage_home won’t create the home directory for an existing user.

Chef Version

chef-client 12.16.42

Platform Version

CentOS 6.8 x86_64

Replication Case

I’m using kitchen with bento/centos-6.8 and VirtualBox.

To set up a contrived example, run a recipe that creates a user:

user 'foo' do
  action :create
end

…This should create the user, but not the home directory.

Then update the resource to …

user 'foo' do
  action :create
  manage_home true
end

…and run chef-client to converge again. You should see that the user resource does not update, and a home directory still does not exist, despite that the manage_home property, according to the docs, will create the home directory if it doesn’t exist.

Compare that to a chef-client run that creates user foo with manage_home true set when the user doesn’t already exist. The home directory is created as expected.

Expected behavior

I would expect adding manage_home true to modify an existing user. CREATE_HOME is set to yes in /etc/login.defs in bento/centos-6.8 by default.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

That’s fine, but please dont’ close this until the docs reflect reality.