Provisioning Vagrant with Chef


#1

Hi,

I am trying to provision vagrant with chef and also get it to work with
WebSphere Liberty Profile. I have edited the config block in the vagrant file
as shown below to try and get chef set up with the jar files and accept the wlp
licence.

config.vm.provision :chef_solo do |chef|
chef.log_level = "debug"
chef.json = {
“wlp” => {
“archive” => {
“accept_license” => “true”,
“base_url” => “file:///vagrant/”,
“runtime” =>
“file:///vagrant/wlp-developers-runtime-8.5.5.3.jar”,
“extended” =>
“file:///vagrant/wlp-developers-extended-8.5.5.3.jar”
}
}
}

chef.run_list = [
  'recipe[acmeair_ci::default]'
]

end

Whenever I try and provision vagrant with chef I get the following error:

==> default: Recipe Compile Error in
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/acmeair_ci/recipes/default.rb
==> default:

==> default:
==> default: TypeError
==> default: ---------
==> default: can’t convert Symbol into Integer
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default:
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/_archive_install.rb:34:in
[]' ==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/_archive_install.rb:34:infrom_file’
==> default:
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/default.rb:56:in
from_file' ==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/acmeair_ci/recipes/default.rb:14:infrom_file’
==> default:
==> default: Relevant File Content:
==> default: ----------------------
==> default:
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/_archive_install.rb:
==> default:
==> default: 27: end
==> default: 28:
==> default: 29: unless node[:wlp][:archive][:accept_license]
==> default: 30: raise “You must accept the license to install WebSphere
Application Server Liberty Profile.”
==> default: 31: end
==> default: 32:
==> default: 33: runtime_dir = “#{node[:wlp][:base_dir]}/wlp”
==> default: 34>> runtime_uri =
::URI.parse(node[:wlp][:archive][:runtime][:url])
==> default: 35: runtime_filename = ::File.basename(runtime_uri.path)
==> default: 36:
==> default: 37: # Fetch the WAS Liberty Profile runtime file
==> default: 38: if runtime_uri.scheme == “file”
==> default: 39: runtime_file = runtime_uri.path
==> default: 40: else
==> default: 41: runtime_file =
"#{Chef::Config[:file_cache_path]}/#{runtime_filename}"
==> default: 42: remote_file runtime_file do
==> default: 43: source node[:wlp][:archive][:runtime][:url]
==> default:
==> default:
==> default: [2014-12-05T11:23:46+00:00] DEBUG: Re-raising exception: TypeError

  • can’t convert Symbol into Integer

I am new to most of this so my terminology will not be very good and I probably
haven’t provided enough info, but any pointers in the right direction or
requests for more info would be very useful.

Thanks


#2

I assume you’re using this cookbook: https://github.com/WASdev/ci.chef.wlp

If so, you’re missing one level of attributes here, which is the [:url] element.

  • Julian

On Fri, Dec 5, 2014 at 8:45 AM, ashleylukerobertson@hotmail.com wrote:

Hi,

I am trying to provision vagrant with chef and also get it to work with
WebSphere Liberty Profile. I have edited the config block in the vagrant file
as shown below to try and get chef set up with the jar files and accept the wlp
licence.

config.vm.provision :chef_solo do |chef|
chef.log_level = "debug"
chef.json = {
“wlp” => {
“archive” => {
“accept_license” => “true”,
“base_url” => “file:///vagrant/”,
“runtime” =>
“file:///vagrant/wlp-developers-runtime-8.5.5.3.jar”,
“extended” =>
“file:///vagrant/wlp-developers-extended-8.5.5.3.jar”
}
}
}

chef.run_list = [
  'recipe[acmeair_ci::default]'
]

end

Whenever I try and provision vagrant with chef I get the following error:

==> default: Recipe Compile Error in
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/acmeair_ci/recipes/default.rb
==> default:

==> default:
==> default: TypeError
==> default: ---------
==> default: can’t convert Symbol into Integer
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default:
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/_archive_install.rb:34:in
[]' ==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/_archive_install.rb:34:infrom_file’
==> default:
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/default.rb:56:in
from_file' ==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/acmeair_ci/recipes/default.rb:14:infrom_file’
==> default:
==> default: Relevant File Content:
==> default: ----------------------
==> default:
/tmp/vagrant-chef-3/chef-solo-1/cookbooks/wlp/recipes/_archive_install.rb:
==> default:
==> default: 27: end
==> default: 28:
==> default: 29: unless node[:wlp][:archive][:accept_license]
==> default: 30: raise “You must accept the license to install WebSphere
Application Server Liberty Profile.”
==> default: 31: end
==> default: 32:
==> default: 33: runtime_dir = “#{node[:wlp][:base_dir]}/wlp”
==> default: 34>> runtime_uri =
::URI.parse(node[:wlp][:archive][:runtime][:url])
==> default: 35: runtime_filename = ::File.basename(runtime_uri.path)
==> default: 36:
==> default: 37: # Fetch the WAS Liberty Profile runtime file
==> default: 38: if runtime_uri.scheme == “file”
==> default: 39: runtime_file = runtime_uri.path
==> default: 40: else
==> default: 41: runtime_file =
"#{Chef::Config[:file_cache_path]}/#{runtime_filename}"
==> default: 42: remote_file runtime_file do
==> default: 43: source node[:wlp][:archive][:runtime][:url]
==> default:
==> default:
==> default: [2014-12-05T11:23:46+00:00] DEBUG: Re-raising exception: TypeError

  • can’t convert Symbol into Integer

I am new to most of this so my terminology will not be very good and I probably
haven’t provided enough info, but any pointers in the right direction or
requests for more info would be very useful.

Thanks


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]