- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Chef 安装 Graphite 服务器,但遇到错误,提示在 VM 上找不到 Chef-solo 或 Chef-client。我使用的是 Ubuntu 12.04.amd64 LTS,这是服务器版本,因此不会安装 Chef-client。我知道 13 版本会自动安装厨师客户端,但我不能使用 13 版本。
我用谷歌搜索,看到有些人建议通过 ssh 连接到盒子并 apt-get install chef-client。
我的问题是:无论如何,我可以在厨师加入之前预装厨师客户端吗?基本上我希望我的厨师程序下载原始图像并在没有用户额外手动步骤的情况下完成所有操作。是否可以?
我的 Vagrant 文件:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu-12.04-amd64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.hostname = "graphite"
config.vm.network :forwarded_port, guest: 8080, host: 9090
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.roles_path = "roles"
chef.data_bags_path = "data_bags"
chef.add_role "Graphite-Server"
chef.add_role "StatsD-Server"
end
end
[default] Running provisioner: chef_solo...
The chef binary (either `chef-solo` or `chef-client`) was not found on
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.
最佳答案
我找到了 2 个解决方案,并且都按预期工作:
1) 方法一:
在您的 Vagrantfile 中,添加config.omnibus.chef_version = :latest
这将确保 厨师独奏或 厨师客户安装在 VM 上,是 Chef 配置所必需的。要使用综合插件,请确保先安装插件:vagrant plugin install vagrant-omnibus
2) 方法二:使用 config.vm.provision
此处提到的 shell 内联:https://github.com/mitchellh/vagrant-aws/issues/19#issuecomment-15487131 .在您的 Vagrantfile 中,添加:config.vm.provision "shell", path: "utils/tools/install_chef.bash"
脚本实用程序/工具/install_chef.bash 我写的看起来像这样:
#!/bin/bash
function error
{
echo -e "\033[1;31m${1}\033[0m" 1>&2
}
function checkRequireRootUser
{
if [[ "$(whoami)" != 'root' ]]
then
error "ERROR: please run this program as 'root'"
exit 1
fi
}
function installChef()
{
if [[ "$(which chef-client)" = '' ]]
then
local chefProfilePath='/etc/profile.d/chef.sh'
curl -s -L 'https://www.opscode.com/chef/install.sh' | bash && \
echo 'export PATH="/opt/chef/embedded/bin:$PATH"' > "${chefProfilePath}" && \
source "${chefProfilePath}"
fi
}
function main()
{
checkRequireRootUser
installChef
}
main
Unknown configuration section 'omnibus'
.这意味着您缺少综合插件。要安装它,请键入:
vagrant plugin install vagrant-omnibus
关于chef-infra - Vagrant 在基础镜像上安装 Chef-client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21274437/
我正在尝试使用命令在 centos 上安装 berks: [root@ip~]#gem install berkshelf --no-ri --no-rdoc 安装后,我使用以下命令验证了是否安装了
我正在尝试使用 ChefSpec 在 Chef 中测试提供程序。在这个提供者中,我正在调用另一个外部提供者,我想模拟/禁用它,以便只执行我的提供者,而不是外部提供者。 我的提供者基本上是这样的: ac
我只是想在厨师中创建一本简单的食谱。我正在使用图书馆作为学习过程。 module ABC class YumD def self.pack (*count) for i in
我正在改编 Apache Recipe 以与 2.4 Apache 一起使用。 Opscode 说明书当前失败,因为它生成的 conf 文件包含从 Apache 2.4 关键字列表中排除的 LockF
我想做这样的事情: 属性/default.rb if node[:chef_environment] == 'dev' include_attribute "mbev::dev" else
好的,所以这开始是因为我试图让自动缩放的节点向 Chef 进行自我注册。我的 client.rb 中有以下内容文件: node_name "some_prefix-#{`hostname`}" 这个想
我已经通过使用Chef创建了一个用户“testuser”。如何使该用户成为sudo用户? 最佳答案 有一种方法可以使用group资源来修改sudo组: group "create testuser s
我是chef的新手,刚开始使用machine和LWRP资源。 在进行大量阅读时,我发现了converge_by一词。这是什么意思? 最佳答案 如果您编写自己的纯Ruby代码,以修改LWRP中的系统,那
我有节点的配方和属性文件。例如。本地主机和 linode。我试图在默认或其他属性之前先加载属性文件(并设置主机名等)。例子: 属性/本地主机.rb: default[:hostname] = "loc
在test-kitchen中,有没有办法更新创建的实例而不是每次都销毁和重新创建实例?假设我更改了 kitchen.yml 并希望看到该更改,运行整个 destroy/create 可能需要一段时间。
我正在遵循确切的语法,但是在向我的一个节点添加角色时看到一些奇怪的行为 我正在运行以下命令,该命令理想情况下应添加角色-将Web服务器添加到do_node knife node run_list ad
我正在寻找关于厨师的重启机制如何在幕后工作的解释。我在网上找不到它的任何文档,并且在试图跟踪代码时遇到了困难(触发器是令人毛骨悚然的远距离 Action )。 我们具体看nginx ,并假设我们使用的
在哪里可以找到已部署的说明书版本? 似乎自动属性不听版本。 有没有办法访问食谱或模板中某处的cookbook_version? 最佳答案 您必须访问 Chef 运行知道的食谱集合。 run_conte
Chef中收敛和幂等的基本区别是什么? 最佳答案 收敛和幂等不是 Chef 特有的。它们通常归因于配置管理理论,尽管在其他领域也有使用,尤其是数学。 让我们从更基本的幂等开始。我们将忽略幂等的数学用法
我目前在食谱中使用此代码: template "/var/django/.ssh/id_rsa" do source "id_rsa.erb" owner "django" g
resource_directory只有2个可用操作:create和delete 我需要递归更新目录的所有者和组。 我怎么做? 使用简单的resource_execute? execute "chow
我一直在尝试找出如何将节点名称(knife bootstrap -N)放入模板中。我尝试了十二种不同的想法,但还没有发现任何可行的方法。有人知道如何从厨师食谱中访问吗? 另外-有没有办法列出厨师食谱可
我有一个Vagrant系统已启动并正在运行,我想对其进行更改,这一更改与更改转发规则之一一样少。 从this page: Forwarded ports are applied during vagr
假设我在 Recipe 中有一个默认属性: default.nginx_upstreams = { 'service1' => ['service1.server.com'], 'se
我使用的 ChefDK 具有以下版本: Chef Development Kit Version: 0.17.17 chef-client version: 12.13.37 delivery ver
我是一名优秀的程序员,十分优秀!