I want to use [chef-rbenv][1]
cookbook.
I created a Berksfile
in a chef-repo top directory like this:
source "https://api.berkshelf.com"
cookbook 'rbenv'
And installed cookbook by berks vendor cookbooks
.
Then I added a "recipe[rbenv::user]"
to server config json file.
According to the document I must set a variable node.default['rbenv']['user_installs']
to install rbenv. But I couldn't figure out where I should write it.
Can anyone show me where and how should I write the variable?
**My Environments (Edit)
I'm using local mode
like this:
$ sudo chef-client --local-mode -c solo.rb -j localhost.json
solo.rb
base = File.expand_path('..', __FILE__)
file_cache_path "/tmp/chef-solo"
cookbook_path ["#{base}/site-cookbooks", "#{base}/cookbooks"]
role_path "#{base}/roles"
localhost.json
{
"run_list" : [
"recipe[rbenv::user]"
]
}
Berksfile
source "https://api.berkshelf.com"
cookbook 'rbenv'
roles/rbenv.rb
name "rbenv"
default_attributes({
'rbenv' => {
'user_installs' => {
'user' => 'ironsand',
'rubies' => ['1.9.3-p0'],
'global' => '1.9.3-p0',
}
},
})
And this is the error when I run the command:
Starting Chef Client, version 11.14.6
[2014-09-18T03:56:08+09:00] WARN: Child with name 'vm-mint.json' found in multiple directories: /home/ironsand/my_chef_repo/nodes/vm-mint.json and /home/ironsand/my_chef_repo/nodes/vm-mint.json
resolving cookbooks for run list: ["rbenv::user"]
Synchronizing Cookbooks:
- git
- rbenv
- dmg
- yum-epel
- build-essential
- apt
- windows
- runit
- ohai
- yum
- chef_handler
Compiling Cookbooks...
================================================================================
Recipe Compile Error
================================================================================
Chef::Exceptions::RecipeNotFound
--------------------------------
could not find recipe user for cookbook rbenv
Running handlers:
[2014-09-18T03:56:10+09:00] ERROR: Running exception handlers
Running handlers complete
[2014-09-18T03:56:10+09:00] ERROR: Exception handlers complete
[2014-09-18T03:56:10+09:00] FATAL: Stacktrace dumped to /tmp/chef-solo/chef-stacktrace.out
Chef Client failed. 0 resources updated in 3.019030351 seconds
[2014-09-18T03:56:10+09:00] ERROR: could not find recipe user for cookbook rbenv
[2014-09-18T03:56:10+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)