sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 218 forks source link

You must have ruby-shadow installed for password support #487

Closed the6thBook closed 11 months ago

the6thBook commented 1 year ago

:ghost: Brief Description

I have an ubuntu 20.04 server that runs into an error on the 2nd run of chef-client. The error below: Chef::Exceptions::MissingLibrary: users_manage[chef-created] (create_users::default line 10) had an error: Chef::Exceptions::MissingLibrary: linux_user[Myusername] (create_users::default line 99) had an error: Chef::Exceptions::MissingLibrary: You must have ruby-shadow installed for password support!

A clear and concise description of what the bug is. I have ruby-shadow installed via apt, but I'm getting an error that the package is missing.

Version of the cookbook where you are encountering the issue. create_users 0.1.0 users 8.1.16

Version of chef-client in your environment. Chef Infra Client: 18.2.7

Operating system distribution and release version. Cloud provider if running in the cloud. Ubuntu 20.04.06 LTS

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run chef users cookbook with users coming from a data bag
  2. Users are created
  3. Re-run the chef client
  4. See error: Chef::Exceptions::MissingLibrary: users_manage[chef-created] (create_users::default line 10) had an error: Chef::Exceptions::MissingLibrary: linux_user[Myusername] (create_users::default line 99) had an error: Chef::Exceptions::MissingLibrary: You must have ruby-shadow installed for password support!

:police_car: Expected behavior

I expected that the chef-client to run without error the 2nd time

:heavy_plus_sign: Additional context

This is running fine on the chef server, but gives me this error on the chef workstation.

barracksbuilder commented 1 year ago

I was running into this also. This only seems to happen on Chef 18 (Chef Infra Client, version 18.2.7). When I downgraded to Chef 17 (Chef Infra Client, version 17.10.3) it ran successfully.

the6thBook commented 11 months ago

I was running into this also. This only seems to happen on Chef 18 (Chef Infra Client, version 18.2.7). When I downgraded to Chef 17 (Chef Infra Client, version 17.10.3) it ran successfully.

I'm able to get it to work with other ubuntu servers with 18.2.7, but this one server is not working.

the6thBook commented 11 months ago

Issue was with chef-client not using the sever version of ruby. Need to install ruby-shadow with the chef version: /opt/chef-workstation/embedded/bin/gem install ruby-shadow