Hi All,
I am trying to using Puppet to add a user with a password on an Ubuntu
12.04 system with Ruby 1.8.7. I have tried this in the two ways as detailed
below. In both cases, the attempt fails with the message "Provider useradd
does not support features manages_passwords; not managing attribute
password". I have read various posts about the requirement for libshadow.
In both the approaches I tried, I *think* I am satisfying this but perhaps
not. Any help is appreciated.
1. Install libshadow at the command line and then run my puppet script
$sudo apt-get update
$sudo apt-get install libshadow-ruby1.8
$puppet apply myuserscript
2. Install libshadow as part of my manifest setup. The relevant code from
my classes is:
class hadoop::usr ($usr_name = ''hadoop'', $hashed_pw = undef) {
include ruby::libshadow
group { $usr_name:
ensure => present,
}
user { $usr_name:
ensure => present,
gid => $usr_name,
home => "/home/${usr_name}",
password => $hashed_pw,
managehome => true,
}
Class[''ruby::libshadow''] -> Group[$usr_name] ->
User[$usr_name]
}
class ruby::libshadow {
package {''libshadow-ruby1.8'':
ensure => installed,
}
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/HVFI5mh5Bj8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Vivek Gupta
2013-Mar-14 16:50 UTC
[Puppet Users] Re: Ubuntu 12.04 adding user with password
Hi , I am facing the same error, were you able to get it working ? cheers. On Monday, August 6, 2012 11:33:05 PM UTC+5:30, Aaron Masino wrote:> > Hi All, > > I am trying to using Puppet to add a user with a password on an Ubuntu > 12.04 system with Ruby 1.8.7. I have tried this in the two ways as detailed > below. In both cases, the attempt fails with the message "Provider useradd > does not support features manages_passwords; not managing attribute > password". I have read various posts about the requirement for libshadow. > In both the approaches I tried, I *think* I am satisfying this but perhaps > not. Any help is appreciated. > > 1. Install libshadow at the command line and then run my puppet script > $sudo apt-get update > $sudo apt-get install libshadow-ruby1.8 > $puppet apply myuserscript > > 2. Install libshadow as part of my manifest setup. The relevant code from > my classes is: > > class hadoop::usr ($usr_name = ''hadoop'', $hashed_pw = undef) { > > include ruby::libshadow > group { $usr_name: > ensure => present, > } > user { $usr_name: > ensure => present, > gid => $usr_name, > home => "/home/${usr_name}", > password => $hashed_pw, > managehome => true, > } > Class[''ruby::libshadow''] -> Group[$usr_name] -> User[$usr_name] > } > > class ruby::libshadow { > package {''libshadow-ruby1.8'': > ensure => installed, > } > } >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Jakov Sosic
2013-Mar-15 23:24 UTC
Re: [Puppet Users] Ubuntu 12.04 adding user with password
On 08/06/2012 08:03 PM, Aaron Masino wrote:> 1. Install libshadow at the command line and then run my puppet script > $sudo apt-get update > $sudo apt-get install libshadow-ruby1.8 > $puppet apply myuserscript > 2. Install libshadow as part of my manifest setup. The relevant codeDoes the approach 1 work? About the approach 2 - you should run the agent *twice* because of the way puppet works. Node specifics, like facts and provider options are evaluated *before* compilation of catalog, so it''s obvious that manages_password will not be available. I suggest that you install libshadow in through your installation setup (FAI, cobbler, or whatever do you use, if you use). -- Jakov Sosic www.srce.unizg.hr -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
I think what you are doing will work, but calling the resource with a
require rather than including it as another class may be more elegant.
Something like:
class hadoop::usr ($usr_name = ''hadoop'', $hashed_pw = undef) {
package {''libshadow-ruby1.8'':
ensure => installed,
}
group { $usr_name:
ensure => present,
}
user { $usr_name:
ensure => present,
gid => $usr_name,
home => "/home/${usr_name}",
password => $hashed_pw,
managehome => true,
require =>
Package[''libshadow-ruby1.8''],
}
}
On Monday, August 6, 2012 2:03:05 PM UTC-4, Aaron Masino
wrote:>
> Hi All,
>
> I am trying to using Puppet to add a user with a password on an Ubuntu
> 12.04 system with Ruby 1.8.7. I have tried this in the two ways as detailed
> below. In both cases, the attempt fails with the message "Provider
useradd
> does not support features manages_passwords; not managing attribute
> password". I have read various posts about the requirement for
libshadow.
> In both the approaches I tried, I *think* I am satisfying this but perhaps
> not. Any help is appreciated.
>
> 1. Install libshadow at the command line and then run my puppet script
> $sudo apt-get update
> $sudo apt-get install libshadow-ruby1.8
> $puppet apply myuserscript
>
> 2. Install libshadow as part of my manifest setup. The relevant code from
> my classes is:
>
> class hadoop::usr ($usr_name = ''hadoop'', $hashed_pw =
undef) {
>
> include ruby::libshadow
> group { $usr_name:
> ensure => present,
> }
> user { $usr_name:
> ensure => present,
> gid => $usr_name,
> home => "/home/${usr_name}",
> password => $hashed_pw,
> managehome => true,
> }
> Class[''ruby::libshadow''] -> Group[$usr_name] ->
User[$usr_name]
> }
>
> class ruby::libshadow {
> package {''libshadow-ruby1.8'':
> ensure => installed,
> }
> }
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.