首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >主厨-索罗找不到带Vagrant和Windows的食谱

主厨-索罗找不到带Vagrant和Windows的食谱
EN

Stack Overflow用户
提问于 2015-02-11 00:29:37
回答 1查看 1.5K关注 0票数 2

我正试图用厨师的“iis”烹饪书和流浪汉来管理一个windows web服务器。

当我试图运行厨师独奏,它抛出一个错误,食谱找不到。

错误信息:

代码语言:javascript
复制
sowens-MBP:vagrant-windows sowen$ vagrant provision
==> default: Running provisioner: chef_solo...
==> default: Vagrant does not support detecting whether Chef is installed
==> default: for the guest OS running in the machine. Vagrant will assume it is
==> default: installed and attempt to continue.
Generating chef JSON and uploading...
==> default: Running chef-solo...
==> default: [2015-02-10T16:18:24-08:00] INFO: *** Chef 12.0.3 ***
==> default: [2015-02-10T16:18:24-08:00] INFO: Chef-client pid: 2508
==> default: [2015-02-10T16:18:30-08:00] INFO: Setting the run_list to ["recipe[example-webserver2012]"] from CLI options
==> default:
==> default: [2015-02-10T16:18:30-08:00] INFO: Run List is [recipe[example-webserver2012]]
==> default: [2015-02-10T16:18:30-08:00] INFO: Run List expands to [example-webserver2012]
==> default: [2015-02-10T16:18:30-08:00] INFO: Starting Chef Run for vagrant-2012-r2.nv.com
==> default: [2015-02-10T16:18:30-08:00] INFO: Running start handlers
==> default: [2015-02-10T16:18:30-08:00] INFO: Start handlers complete.
==> default: [2015-02-10T16:18:30-08:00] ERROR: Running exception handlers
==> default:
==> default: [2015-02-10T16:18:30-08:00] ERROR: Exception handlers complete
==> default: [2015-02-10T16:18:30-08:00] FATAL: Stacktrace dumped to C:/var/chef/cache/chef-stacktrace.out
==> default: [2015-02-10T16:18:30-08:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook iis not found. If you're loading iis from another cookbook, make sure you configure the dependency in your metadata
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

Vagrantfile:

代码语言:javascript
复制
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(2) do |config|
  config.vm.box = "lmayorga1980/windows-2012r2"
  config.vm.communicator = "winrm"
  config.vm.network "forwarded_port", host: 3389, guest: 3389
  config.vm.provider "virtualbox" do |v|
    v.cpus = 2
    v.memory = 2048
  end

  # Provisioning
  config.vm.provision "chef_solo" do |chef|
    # chef.cookbooks_path = ['C:\vagrant']
    chef.add_recipe "example-webserver2012"
  end
end

伯克文件

代码语言:javascript
复制
source "https://supermarket.chef.io"

metadata

cookbook 'iis'

metadata.rb

代码语言:javascript
复制
name 'foobar'
...
depends 'iis'

食谱/default.rb

代码语言:javascript
复制
iis_site 'Default Web Site' do
  action [:stop, :delete]
end

整个目录结构如下所示:菜谱是用berks cookbook example-webserver2012创建的。有两个流浪汉文件,我用的是顶层的那个。

代码语言:javascript
复制
$ tree vagrant-windows/
vagrant-windows/
├── Vagrantfile
└── cookbooks
    └── example-webserver2012
        ├── Berksfile
        ├── Berksfile.lock
        ├── CHANGELOG.md
        ├── Gemfile
        ├── Gemfile.lock
        ├── LICENSE
        ├── README.md
        ├── Thorfile
        ├── Vagrantfile
        ├── attributes
        ├── chefignore
        ├── files
        │   └── default
        ├── libraries
        ├── metadata.rb
        ├── providers
        ├── recipes
        │   └── default.rb
        ├── resources
        ├── templates
        │   └── default
        └── test
            └── integration

为什么没有找到食谱“iis”?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-11 12:49:49

之所以找不到IIS,是因为您的包装食谱example-webserver2012声明了对IIS的依赖关系。不幸的是,与主厨单独供应不知道如何解决伯克基依赖的盒子。你有几个选择。

  • 使用berks vendor创建一个包含所有解析食谱的文件夹,并将Vagrantfile指向该文件夹。
  • 在运行漂泊式搁板时,可以使用vagrant provision插件来进行底层依赖解决。

从工作流的角度来看,我发现vagrant berkshelf插件非常有用。

在您的Berksfile中,您不需要声明IIS上的依赖项,该依赖项将从metadata.rb中提取,因为您的metadata文件中有metadata行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28444481

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档