A collection of task oriented solutions in Puppet

 

User Password Management Fails in Puppet

Challenge

You want to control a users password through puppet but receive a warning.

Solution

class user_password {

  user { 'mcfakey':
    ensure   => 'present',
    password => '$1$9VC1vFFa$GHKWgtdODti8eKqkQ7Ruv.'
  }

}
    info: /User[mcfakey]: Provider useradd does not support features manages_passwords; not managing attribute password

Explanation

You are trying to manage a users password through puppet but you are receiving a message like this:

    info: /User[mcfakey]: Provider useradd does not support features manages_passwords; not managing attribute password

This means that the ruby language support that puppet needs in order to control a users password is absent. If you're running on CentOS / Fedora this can be fixed by installing the ruby-shadow package and on Debian / Ubuntu libshadow-ruby will fulfil the requirement. This is most often seen on gem or source based installs as your package manager should handle this dependency when installing puppet via a package.

It's worth noting that the user resource will still be added but the password will not be set to the value you chose.

TODO extract the libshadow-ruby in puppet code.