vagrant - Chef Solo Jetty Cookbook Attributes -
i'm having issue chef.json
attributes in vagrantfile seem getting ignored/overwritten.
environment: mac os x 10.8 host, ubuntu 12.04 guest virtualized in virtualbox 4.18. using berkshelf cookbook dependencies , opscode cookbooks of recipes.
the box spinning fine, i'm trying configure more if downloaded jetty , un-tarred archive, rather bunch of symlinks /usr/share/jetty
on filesystem way seems defaulting to.
here's chef portion of vagrantfile:
config.vm.provision :chef_solo |chef| chef.json = { :java => { :install_flavor => "oracle", :jdk_version => '7', :oracle => { :accept_oracle_license_terms => true } }, :jetty => { :port => '8080', :home => '/opt/jetty', :config_dir => '/opt/jetty/conf', :log_dir => '/opt/jetty/log', :context_dir => '/opt/jetty/context', :webapp_dir => '/opt/jetty/webapp' } } chef.add_recipe "apt" chef.add_recipe "mongodb::default" chef.add_recipe "java" chef.add_recipe "jetty" end
chef seems reading chef.json
because can change jetty's port in vagrantfile.
i've tried change these attributes in attributes/default.rb
of jetty cookbook, didn't either.
what missing?
if take @ below block in jetty/recipes/default.rb
jetty_pkgs = value_for_platform( ["debian","ubuntu"] => { "default" => ["jetty","libjetty-extra"] }, ["centos","redhat","fedora"] => { "default" => ["jetty6","jetty6-jsp-2.1","jetty6-management"] }, "default" => ["jetty"] ) jetty_pkgs.each |pkg| package pkg action :install end end
for debian/ubuntu, default recipe uses deb packages official repository instead of want (download binary official website, untar preferred location).
because deb packages have own specifications (run dpkg -l jetty
see files/directories structure), reckon that's why attribute overrides in chef.json did not work.
you can enable debugging output see more information when run provision again
vagrant_log=debug vagrant up
note: it's better off writing own cookbook download binary , untar set permissions , other stuff if want jetty installed way like;-)
Comments
Post a Comment