Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.run_state['root_path'] conflicts with rbenv cookbook #68

Closed
petracvv opened this issue Jun 17, 2020 · 1 comment
Closed

node.run_state['root_path'] conflicts with rbenv cookbook #68

petracvv opened this issue Jun 17, 2020 · 1 comment

Comments

@petracvv
Copy link
Contributor

👻 Brief Description

This is a companion issue to this rbenv issue: sous-chefs/ruby_rbenv#285

When using both the rbenv and pyenv cookbooks together and installing python and ruby versions for the same user, the resources from the 2nd cookbook do not work. This is because the same internal run_state attribute is used for tracking the root_path in both cookbooks.

🥞 Cookbook version

3.2.0

👩‍🍳 Chef-Infra Version

14.13.11

🎩 Platform details

RHEL7

Steps To Reproduce

Steps to reproduce the behavior:

  1. Write cookbook that creates a user and installs a ruby and python version for that user:
     user 'jenkins' do
       manage_home true
     end

     rbenv_user_install 'jenkins'

     rbenv_ruby '2.7.1' do
       user 'jenkins'
     end

     pyenv_user_install 'jenkins'

     pyenv_python '3.8.2' do
       user 'jenkins'
     end
  1. Run the recipe against a node in test-kitchen or a test env.
  2. See the pyenv python installation fail

🚓 Expected behavior

I expect that both the ruby and python versions are installed with no error.

➕ Additional context

I can work around the problem with a ruby block in between the pyenv and rbenv resources:

ruby_block 'unset run_state' do
  block do
    node.run_state['root_path'] = {}
  end
end
@xorima
Copy link
Contributor

xorima commented Jun 18, 2020

Hey,

Thanks for reporting this,

So this comes down to us doing things wrong in both cookbooks (We should be namespacing the run state to be something like: node.run_state['sous-chefs']['cookbook_name']['root_path'])

Is this something you could alter on a PR for us, or would you rather I do it on both cookbooks?

Thanks

Jason

Relates to: sous-chefs/ruby_rbenv#285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants