Ask Your Question
0

creating user does not create home directory

asked 2013-09-26 18:08:25 -0500

spuder gravatar image

updated 2013-09-26 19:01:51 -0500

Why is it that when I create the following user, the following problems occur?

  1. The home directory is not created.
  2. The uid is not a system id (less than 500)

Using ubuntu 12.04

class gitlab::setup {
  user { 'git' : 
    name      => 'git',
    ensure    => present, 
    shell     => '/bin/bash',
    password  => '*',
    home      => '/home/git',
    system    => true,                      #Makes sure user has uid less than 500
    managehome => true,

  }
}

cat /vagrant/tests/setup.pp
include gitlab::setup

After a puppet apply, the git user is present, but has an id of 997 and no home directory

root@ubuntu-server-12042-x64-vbox4210-nocm:/home# id git
uid=997(git) gid=997(git ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-09-26 19:01:21 -0500

spuder gravatar image

I can't explain it, but It started working after I made a few minor tweaks to the setup.pp file.

It appears that others have experienced strange behavior creating users https://groups.google.com/forum/#!topic/puppet-users/EkT8H779j4E

 class gitlab::setup inherits gitlab {
  user { 'git' : 
    name        => 'git',
    ensure      => present, 
    shell       => '/bin/bash',
    password   => '*',
    home        => '/home/git/',
    system      => true,                      #Makes sure user has uid less than 500
    managehome  => true,
    comment     => 'foo',


  }#end user
}

The only difference I can see is I added 'comment => foo'. I tried going back to the original syntax, but the problem went away. I suspect there ... (more)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-09-26 18:08:25 -0500

Seen: 4,756 times

Last updated: Sep 26 '13