Albert,It's not the 'shadow' gem you need - it's the C extension named 'libshadow-ruby'. This is available as a package on most system Ruby installations. If you use REE, you might want to try running this cookbook with chef-solo beforehand:Alternatively you can manually install the library in the 'files' directory in the cookbook (I can never find the original download location for this thing).- JoshuaOn Feb 1, 2010, at 11:52 AM, Albert Llop wrote:Hello there,we want to change the password of the only user created in all of our chef clients (well, the user we use to log in through ssh). In our recipe we have this:package "libshadow-ruby1.8"user "kom" docomment "Kings of Mambo user"gid "users"uid 1000home "/home/kom"supports :manage_home => trueshell "/bin/bash"password "<snip>"not_if "grep 'kom:<snip> /etc/shadow"endThis worked for some time, and I just can't understand what happened, because it doesn't anymore. I changed the <snip>'d part to have a new password, uploaded to the chef-server, and executed chef-client on a client. this is the log (yes, we're still on 0.7.4, hope that's ok :p, been working flawlessly and didn't have the time to worry about upgrades):[Mon, 01 Feb 2010 11:44:26 +0100] ERROR: user[kom] (/srv/chef/cache/cookbooks/basics/recipes/user.rb line 6) had an error:uninitialized constant Shadow::Passwd/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:105:in `const_missing'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/provider/user.rb:73:in `load_current_resource'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:55:in `build_provider'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:86:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:in `each'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:58:in `each'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:57:in `each'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:63:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:373:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:81:in `run'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/client.rb:164:in `run_application'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/client.rb:162:in `loop'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/client.rb:162:in `run_application'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application.rb:57:in `run'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/bin/chef-client:26/usr/bin/chef-client:19:in `load'/usr/bin/chef-client:19[Mon, 01 Feb 2010 11:44:26 +0100] ERROR: NameError[Mon, 01 Feb 2010 11:44:26 +0100] FATAL: uninitialized constant Shadow::Passwd/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:105:in `const_missing'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/provider/user.rb:73:in `load_current_resource'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:55:in `build_provider'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:86:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:in `each'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:58:in `each'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:57:in `each'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:63:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:373:in `converge'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:81:in `run'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/client.rb:164:in `run_application'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/client.rb:162:in `loop'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/client.rb:162:in `run_application'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application.rb:57:in `run'/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.4/bin/chef-client:26/usr/bin/chef-client:19:in `load'/usr/bin/chef-client:19In the highlighted file, there's this line:shadow_info = Shadow::Passwd.getspnam(@new_resource.username)A couple of lines before there's a require 'shadow'. I installed the shadow gem (sudo gem install shadow), but nothing changed, and I don't think that was the desired action anyway since the Shadow gem is an ActiveRecord restful server.The package libshadow-ruby1.8 is already installed (from day 1 of the installation)--# apt-get install libshadow-ruby1.8Reading package lists... DoneBuilding dependency treeReading state information... Donelibshadow-ruby1.8 is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.I'm out of ideas. Can't find that Shadow::Passwd anywhere. I can change passwords everywhere manually, but would rather spend the time trying to fix this. Any idea/tip/help is most welcome.Thanks!!
Albert Llop
Archive powered by MHonArc 2.6.16.