使用chef windows-package安装windows应用程序

时间:2014-05-16 19:32:58

标签: chef chef-solo

我正在尝试使用Chef的“windows-master”菜谱在Windows 7计算机上安装软件包:https://github.com/opscode-cookbooks/windows。我做的第一件事是抓住安装firefox示例并尝试让它在我的环境中运行。我在运行chef-client时出错:

Starting Chef Client, version 11.12.4
[2014-05-16T15:15:50-04:00] INFO: *** Chef 11.12.4 ***
[2014-05-16T15:15:50-04:00] INFO: Chef-client pid: 1528
[2014-05-16T15:16:03-04:00] INFO: Run List is [role[WindowsUserDesktop]]
[2014-05-16T15:16:03-04:00] INFO: Run List expands to [AdminUserAccounts::monito
r_user, Windows7x32Desktop::InstallFirefox]
[2014-05-16T15:16:03-04:00] INFO: Starting Chef Run for Windows7Node
[2014-05-16T15:16:03-04:00] INFO: Running start handlers
[2014-05-16T15:16:03-04:00] INFO: Start handlers complete.
resolving cookbooks for run list: ["AdminUserAccounts::monitor_user", "Windows7x
32Desktop::InstallFirefox"]
[2014-05-16T15:16:04-04:00] INFO: Loading cookbooks [AdminUserAccounts@0.1.4, Wi
ndows7x32Desktop@0.1.7, windows-master@1.31.1, chef_handler@1.1.7]
Synchronizing Cookbooks:
  - AdminUserAccounts
[2014-05-16T15:16:04-04:00] INFO: Storing updated cookbooks/Windows7x32Desktop/r
ecipes/InstallFirefox.rb in the cache.
  - Windows7x32Desktop
  - windows-master
  - chef_handler
Compiling Cookbooks...

================================================================================

Recipe Compile Error in c:/chef/cache/cookbooks/Windows7x32Desktop/recipes/Insta
llFirefox.rb
================================================================================
Chef::Exceptions::ValidationFailed
----------------------------------
Option installer_type must be a kind of [String]!  You passed :custom.

Cookbook Trace:
---------------
  c:/chef/cache/cookbooks/Windows7x32Desktop/recipes/InstallFirefox.rb:20:in `bl
ock in from_file'
  c:/chef/cache/cookbooks/Windows7x32Desktop/recipes/InstallFirefox.rb:16:in `fr
om_file'

Relevant File Content:
----------------------
c:/chef/cache/cookbooks/Windows7x32Desktop/recipes/InstallFirefox.rb:

 13:  # action :create_if_missing
 14:  #end
 15:
 16:  windows_package 'Mozilla_Firefox30' do
 17:    action :install
 18:    source 'https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/30.0b1/
win32/en-US/Firefox%20Setup%20Stub%2030.0b1.exe'
 19:            options '-ms'
 20>>           installer_type :custom
 21:  end
 22:
 23:
 24:
 25:


Running handlers:
[2014-05-16T15:16:04-04:00] ERROR: Running exception handlers
Running handlers complete
[2014-05-16T15:16:04-04:00] ERROR: Exception handlers complete
[2014-05-16T15:16:04-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stack
trace.out
Chef Client failed. 0 resources updated in 19.84961 seconds
[2014-05-16T15:16:04-04:00] INFO: Sending resource update report (run-id: 5c1b1d
60-dbf6-4f95-af8f-4a979244aee8)
[2014-05-16T15:16:04-04:00] FATAL: Chef::Exceptions::ValidationFailed: Option in
staller_type must be a kind of [String]!  You passed :custom.

考虑到复制并粘贴了该示例,我有点困惑,除了我更改的URL以反映最新的Firefox版本。

我看了一下我下载的windows-master版本中的package.rb资源,“installer_type”属性没有查找“String”类型。这里仅供参考。

actions :install, :remove

default_action :install

attribute :package_name, :kind_of => String, :name_attribute => true
attribute :source, :kind_of => String, :required => true
attribute :version, :kind_of => String
attribute :options, :kind_of => String
attribute :installer_type, :kind_of => Symbol, :default => nil, :equal_to => [:msi, :inno, :nsis, :wise, :installshield, :custom]
attribute :checksum, :kind_of => String
attribute :timeout, :kind_of => Integer, :default => 600
attribute :success_codes, :kind_of => Array, :default => [0, 42, 127]

# TODO

# add preseeding support
#attribute :response_file

# allow target dirtory of installation to be set
#attribute :target_dir

# Covers 0.10.8 and earlier
def initialize(*args)
  super
  @action = :install
end

任何帮助都将不胜感激。

0 个答案:

没有答案