【问题标题】:Adding Dependencies to Chef Cookbooks向 Chef Cookbooks 添加依赖项
【发布时间】:2014-03-07 05:55:40
【问题描述】:

使用 chef-solo,我正在尝试启动一个安装 git 的简单 VM。

我有一个“cookbooks”目录,还有一个 Vagrantfile。

-cookbooks    
-Vagrantfile

流浪文件

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "centos_64"

  config.vm.network "forwarded_port", guest: 80, host: 8085 
  config.omnibus.chef_version = :latest

  ...

  config.vm.provision :chef_solo do |chef|
     chef.add_recipe "build-essential"
     chef.add_recipe "dmg"
     chef.add_recipe "yum"
     chef.add_recipe "git"
  end
end

我将git 食谱克隆到我的食谱目录。但是,我遇到了一个问题:

[2014-03-06T21:09:58+00:00] ERROR: Cookbook runit not found. If you're loading 
runit from another cookbook, make sure you configure the dependency in your 
metadata
[2014-03-06T21:09:58+00:00] FATAL: Chef::Exceptions::ChildConvergeError: 
Chef run process exited unsuccessfully (exit code 1)

与其继续向我的 Vagrantfile 添加更多说明书依赖项,不如处理依赖项的正确方法是什么?

【问题讨论】:

    标签: dependencies chef-infra


    【解决方案1】:

    查看http://berkshelf.com。它允许您创建一个 Berksfile,您可以在其中指定所需的 gem,并处理依赖项解析。

    【讨论】:

      猜你喜欢
      • 2016-04-13
      • 2017-03-07
      • 1970-01-01
      • 2020-01-20
      • 2016-11-24
      • 2015-08-01
      • 1970-01-01
      • 2016-03-22
      • 1970-01-01
      相关资源
      最近更新 更多