set user password ubuntu

asked 2014-07-13 13:49:47 -0500

Boedy gravatar image

updated 2014-07-14 16:13:43 -0500

I just started using Puppet this weekend and I'm liking it so far. I keep running into problems though. I've searched allot for this, but could not find a solution.

I'm trying to create a new user with a password. See code below. I'm using vagrant with the ubuntu precise64 box.

user { 'testuser':
    ensure => present,
    password => '$1$1O.gwTeF$CjhqFGsKhmt3Sc9X0v6ve.',
    provider => 'useradd'
}

The user get's created, but the password isn't set however. I know because the file: /etc/shadow shows me:

testuser:!:16264:0:99999:7:::

I also ran: sudo apt-get install libshadow-ruby1.8

What am I doing wrong?

edit retag flag offensive close merge delete

Comments

Are you making a new user? Or trying to update the password of an existing user? Try removing the 'provider' line.

spuder gravatar imagespuder ( 2014-07-14 12:09:46 -0500 )edit

Yes, I'm creating a new user. I started out without the provider line. Makes no difference.

Boedy gravatar imageBoedy ( 2014-07-14 16:11:21 -0500 )edit

can you attach the output of `puppet agent --debug --verbose`? This may tell us if puppet somehow does not recognize the `libshadow` feature or if something else is going wrong

Stefan gravatar imageStefan ( 2014-07-14 19:37:05 -0500 )edit