我是Chef的新手,并尝试使用ark在Windows VM节点上安装JMeter。我创建了一个名为my_jmeter_install的食谱。我将以下windows特定属性添加到my_jmeter_install.rb -
normal['ark']['win_install_dir'] = 'C:\Users\Administrators\JMeter'
在my_jmeter_install食谱的metadata.rb中,我添加了 - 取决于“ark”
在my_jmeter_install食谱的default.rb中,我添加了 -
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
当我收敛节点时,我收到以下错误 -
================================================================================
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
我没有找到任何使用ark for windows的例子。有人可以帮我解决my_jmeter_install食谱中的错误吗?如果使用ark不是推荐的安装方式,那是什么? 谢谢!
答案 0 :(得分:1)
我想关闭此帖子以防其他人遇到此问题。将win_install_dir属性添加到配方代码解决了这个问题。
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