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 the ruby language support that puppet needs to manage a users password is missing and requires additional software to be installed. 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 in 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.