Linux でシェフを試した後、Windows 環境で試しています。したがって、私の最初の目標は次のとおりです。
- ローカル Windows マシンでシェフ クライアントをセットアップする
- chef-solo で Windows パッケージをインストールする簡単なレシピを書く
Windowsクックブックを使用してインストールできなかったため、ポイント2で立ち往生しています。Windowsプラットフォームでこれを使用する方法がわからないかもしれません。ですから、ここにいる誰かが私のエラーを見つけてくれることを願っています。
私がしたことは:
- opscode-windows- cookbooks から Windows クックブックをダウンロードし ました。
- クックブックをクックブック フォルダーにコピーしました。
- PuTTY をインストールするためのコードを追加して、windows-master フォルダーにある default.rb を編集しました。
- 次の内容の testrole.json ファイルを作成しました。
{ "run_list": [ "レシピ[windows-master]" ] }
- 次の内容の solo.rb ファイルを作成しました。
cookbook_path "C:/chef/chef-repo/cookbooks"
C:\chef\chef-repo>chef-solo -c solo.rb -j testrole.json
Starting Chef Client, version 11.10.0
Compiling Cookbooks...
Recipe: windows-master::default
* chef_gem[win32-api] action install (up to date)
* chef_gem[win32-service] action install (up to date)
* chef_gem[windows-api] action install (up to date)
* chef_gem[windows-pr] action install (up to date)
* chef_gem[win32-dir] action install (up to date)
* chef_gem[win32-event] action install (up to date)
* chef_gem[win32-mutex] action install (up to date)
================================================================================
Recipe Compile Error in C:/chef/chef-repo/cookbooks/windows-master/recipes/defau
lt.rb
================================================================================
NoMethodError
-------------
No resource or method named `windows_package' for `Chef::Recipe "default"'
Cookbook Trace:
---------------
C:/chef/chef-repo/cookbooks/windows-master/recipes/default.rb:35:in `from_file
'
Relevant File Content:
----------------------
C:/chef/chef-repo/cookbooks/windows-master/recipes/default.rb:
28:
29: # the rest
30: %w{ windows-api windows-pr win32-dir win32-event win32-mutex }.each do |wi
n_gem|
31: chef_gem win_gem do
32: action :install
33: end
34: end
35>> windows_package 'PuTTY version 0.60' do
36: source 'http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-instal
ler.exe'
37: installer_type :inno
38: action :install
39: end
40:
41:
ここで何が欠けていましたか?何か案は。
前もって感謝します。