-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Update RVM to use custom resources #414
base: main
Are you sure you want to change the base?
Conversation
748b092
to
704273b
Compare
@@ -0,0 +1,20 @@ | |||
unified_mode true | |||
|
|||
include_recipe 'rvm::system_install' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason I get an undefined method here when specifying the rvm_ruby
resource. It doesn't make a lot of sense why and I'm still trying to figure it out:
================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/rvm/resources/system.rb
================================================================================
NoMethodError
-------------
undefined method `include_recipe' for #<Class:0x0000000002e5e690>
Cookbook Trace: (most recent call first)
----------------------------------------
/tmp/kitchen/cache/cookbooks/rvm/resources/system.rb:3:in `class_from_file'
Relevant File Content:
----------------------
/tmp/kitchen/cache/cookbooks/rvm/resources/system.rb:
1: unified_mode true
2:
3>> include_recipe 'rvm::system_install'
4:
5: perform_install_rubies = node['rvm']['install_rubies'] == true ||
6: node['rvm']['install_rubies'] == 'true'
7:
8: if perform_install_rubies
9: install_rubies rubies: node['rvm']['rubies'],
10: default_ruby: node['rvm']['default_ruby'],
11: global_gems: node['rvm']['global_gems'],
12: gems: node['rvm']['gems']
System Info:
------------
chef_version=17.9.52
platform=centos
platform_version=7.9.2009
ruby=ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]
program_name=/opt/chef/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2022-02-18T17:13:10+00:00] ERROR: Running exception handlers
Running handlers complete
[2022-02-18T17:13:10+00:00] ERROR: Exception handlers complete
Infra Phase failed. 0 resources updated in 10 seconds
[2022-02-18T17:13:10+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2022-02-18T17:13:10+00:00] FATAL: ---------------------------------------------------------------------------------------
[2022-02-18T17:13:10+00:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
[2022-02-18T17:13:10+00:00] FATAL: ---------------------------------------------------------------------------------------
[2022-02-18T17:13:10+00:00] FATAL: NoMethodError: undefined method `include_recipe' for #<Class:0x0000000002e5e690>
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-centos-7>. Please see .kitchen/logs/default-centos-7.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
This is in a test kitchen run on vagrant with chef_version 17 as you see there and it also happens on version 15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's because this needs to be a resource method instead of include_recipe
and it also needs to be inside a resource. eg:
action :install do
rvm_system_install
...
end
Is this file needed at all? It seems like it's covered by rvm_system_install
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is totally a mess right now. And that one is probably the most busted. I never really want to include_recipes in custom resources. Ideally
- Pull in files from ruby_rbenv - Add docs stubs for new resoruces - Update README Signed-off-by: Dan Webb <[email protected]>
6a4db49
to
150ca87
Compare
Description
Signed-off-by: Dan Webb [email protected]
Check List
## Unreleased