RiotGamesCookbooks / rbenv-cookbook

Installs and configures rbenv
http://community.opscode.com/cookbooks/rbenv
Apache License 2.0
137 stars 109 forks source link

rbenv user ID should be settable by an attribute #76

Open sentience opened 10 years ago

sentience commented 10 years ago

Recipe rbenv::default creates a user rbenv:

user node[:rbenv][:user] do
  shell "/bin/bash"
  group node[:rbenv][:group]
  supports :manage_home => node[:rbenv][:manage_home]
end

Because no numeric user ID is specified here, the next available user ID is selected. This can interfere with essential cookbooks such as users later adding additional users to the machine with specific IDs.

Here’s how this bit me in my case:

  1. Provisioned a new node, which did this:
    • users::default created users with specified IDs 2001, 2002, 2003.
    • rbenv::default created user rbenv with auto-assigned user ID 2004.
  2. At some later date, on my Chef Server, specified a new user in the sequence of IDs: 2004.
  3. The next chef-client run on the existing node failed because ID 2004 was taken by the rbenv user.

I suggest that a default numeric ID should be specified for the rbenv user, and configurable using an attribute:

user node[:rbenv][:user] do
  shell "/bin/bash"
  uid node[:rbenv][:user_uid] # <--
  group node[:rbenv][:group]
  supports :manage_home => node[:rbenv][:manage_home]
end