rmulay
rmulay

Reputation: 41

error using chef cookbook ark to install jmeter on a windows server

I am new to chef and trying to use ark to install JMeter on a windows VM node. I created a cookbook called my_jmeter_install. I added below windows specific attribute to my_jmeter_install.rb – normal['ark']['win_install_dir'] = 'C:\Users\Administrators\JMeter'

In metadata.rb of my_jmeter_install cookbook, I added - depends "ark"

In default.rb of my_jmeter_install cookbook, I added -

include_recipe "ark"
ark 'my_jmeter' do
  url 'http://mirror.cogentco.com/pub/apache//jmeter/binaries/apache-jmeter-2.13.zip'
  version '2.13'
  action :install
end

When I converge the node, I get the following error –

================================================================================
 Error executing action `install` on resource 'ark[my_jmeter]'
 ================================================================================

 ArgumentError
 -------------
 You must supply a name when declaring a directory resource

 Cookbook Trace:
 ---------------
 c:/chef/cache/cookbooks/ark/providers/default.rb:39:in `block in class_from_file'

 Resource Declaration:
 ---------------------
 # In c:/chef/cache/cookbooks/my_jmeter_install/recipes/default.rb

  22: ark 'my_jmeter' do
  23:       url 'http://mirror.cogentco.com/pub/apache//jmeter/binaries/apache-jmeter-2.13.zip'
  24:       version '2.13'
  25:       action :install
  26: end

 Compiled Resource:
 ------------------
 # Declared in c:/chef/cache/cookbooks/my_jmeter_install/recipes/default.rb:22:in `from_file'

 ark("my_jmeter") do
   provider Chef::Provider::Ark
   action [:install]
   retries 0
   retry_delay 2
   default_guard_interpreter :default
   declared_type :ark
   cookbook_name "my_jmeter_install"
   recipe_name "default"
   url "http://mirror.cogentco.com/pub/apache//jmeter/binaries/apache-jmeter-2.13.zip"
   version "2.13"
   extension "zip"
   prefix_bin "/usr/local/bin"
   home_dir "/usr/local/my_jmeter"
   release_file "c:/chef/cache/my_jmeter-2.13.zip"
 end

I did not find any examples for using ark for windows. Can someone help with what is wrong in the my_jmeter_install cookbook? If using ark is not the recommended way to do this install, what is? Thanks!

Upvotes: 1

Views: 758

Answers (1)

rmulay
rmulay

Reputation: 41

I wanted to close this thread in case anyone else runs into this. Adding win_install_dir attribute to the recipe code solved the issue.

ark 'apache-jmeter' do
    url 'http://mirror.cogentco.com/pub/apache//jmeter/binaries/apache-jmeter-2.13.zip'
    version '2.13'
    owner 'administrator'
    win_install_dir 'c:\users\administrator\jmeter'
    strip_components 0
    action :install
end

Upvotes: 1

Related Questions