我正在尝试对某些节点使用chef搜索:
hosts = search(:node, 'chef_environment:STG AND role:elasticsearch')
Chef::Log.warn("Hosts are #{hosts}")
hosts.each do |node|
Chef::Log.warn("hostname is: #{node['name']} and has the following tags #{node["tags"]}")
end
第一个Chef::Log.warn
我已经在Redhat Linux7.2中安装了ChefDK rpm包。
chef-solo --version命令提供正确的版本(Chef: 12.19.36)。
现在,我正在尝试使用以下chef-solo命令运行我的食谱:
chef-solo --override-runlist "recipe[demo_cookbook::default]"
但我收到了以下错误消息:
"Chef encountered an error attempting to load the node data for <my server name>"
Unknown
我已经成功地在一个物理Linux节点上安装了Chef服务器,现在我正在尝试在另一个Linux虚拟机上安装chef-client,不幸的是我得到了下面的错误。
ERROR: Your private key could not be loaded from /etc/chef/webui.pem
Check your configuration file and ensure that your private key is readable
所以将webui.pem从chef服务器复制到Linux客户端,尝试执行刀子客户端列表
ERROR: Failed to authenticate to
我正在尝试在以下代码的帮助下安装java,但默认情况下它安装在/usr/java/目录中。我希望它安装在一个单独的目录上,例如/u 01/app。
食谱
# Remove old environment then notify new environment to be created
ruby_block "delete_environement" do
block do
editBashrc = Chef::Util::FileEdit.new("/home/oracle/.bash_profile")
editBashrc.search
我正在尝试按照opscode网站上的指南在linux Ubuntu上安装chef server。
安装时,我在控制台上看到的第一个错误是:
Setting permissions for user "chef" in vhost "/chef" ...
...done.
Creating config file /etc/chef/solr.rb with new version
* Starting chef-solr chef-solr [fail]
我查看了var/ s
当我运行“厨房会聚”厨房时,我无法安装厨师,输出如下
Installing chef
installing with dpkg...
(Reading database ... 42662 files and directories currently installed.)
Preparing to unpack .../cache/chef_16.1.16-1_amd64.deb ...
Unpacking chef (16.1.16-1) ...
dpkg-deb (subprocess): deco
我正在做厨师供应的工作。为此,我尝试使用chef-provisioning、Oracle Virtual Box和Vagrant。我执行了这个命令:
"**gem install chef-provisioning chef-provisioning-vagrant**"
I got following error:
**Error: Could not find a valid gem 'chef-provisioning-vagrant'**
我毫不犹豫地往前走了。当我执行"chef-client -z vagrant_linux.rb simple
对于此错误消息,没有谷歌点击。
我试图在过去成功运行过的服务器上运行厨师-客户端。我不知道是什么改变了产生这个错误。下面是我能想到的最详细的输出:
> chef-client -l debug
[2014-10-09T17:50:19-05:00] INFO: Forking chef instance to converge...
[2014-10-09T17:50:19-05:00] DEBUG: Fork successful. Waiting for new chef pid: 17823
[2014-10-09T17:50:19-05:00] DEBUG: Forked ins
在我的食谱install_packages中有两个厨师资源块,如下所示
%w[rhel7-x86_x64-linux-custom rhel7-x86_x64-linux-latest].each do |repo|
execute "Enable RHEL #{repo}" do
command "yumtool -a #{repo}"
not_if { :: File.file?("/etc/yum.repos.d/#{repo}.repo") }
end
end
PACKAGES.each do |pkg_entr
我对厨师是个新手,已经学过了很多教程,但我开始认为我不是那个错的人:
我正在尝试在CentOS 7.2上安装Java。它无法安装(显然)-但是将tarball解压到正确的位置,但添加了一个非常不准确(我认为)的符号链接,并且没有正确地设置模式。
这是我的LWRP:
#
# Cookbook Name:: install_java
# Recipe:: default
#
# Copyright (c) 2016 The Authors, All Rights Reserved.
# Used to define which OS to install and thus, which inst
我正在接受厨师伺服器的培训:
学习Chef>Tutorials>Manage a node>Red Hat Enterprise Linux>Hosted Chef>Upload食谱给厨师服务器
本教程刚刚让我在终端中使用"knife cookbook upload learn_chef_httpd",但是当我使用"knife cookbook list"而不是像教程所显示的那样进行验证时,它会返回:
ERROR: Failed to authenticate to https://api.chef.io/organizations
我试着用测试厨房码头在本地测试厨师食谱,我安装了厨师工作站,厨师和测试厨房,但是厨房仍然抱怨“厨房找不到”
-bash: kitchen: command not found
下面是我在我的redhat7 linux机器上安装的内容;
Chef Workstation version: 22.1.778
Chef Habitat version: 1.6.420
Test Kitchen version: 3.2.2
Cookstyle version: 7.31.1
Chef Infra Client version: 17.9.26
Chef InSpec version: 4.52.9
我已经在UbuntuServer14.04上安装了Chef服务器。下载了主厨包(厨师_11.12.8-2_amd64.deb)之后,我运行了sudo dpkg -i chef_11.12.8-2_amd64.deb。
The package seems to have installed properly. The output was:
(Reading database ... 62460 files and directories currently installed.)
Preparing to unpack chef_11.12.8-2_amd64.deb ...
Unpacki
我正在尝试使用chef_client作为置备程序。目前,我收到了这样的消息:
==> default: ================================================================================
==> default: Chef encountered an error attempting to create the client "vagrant-3ccfff14"
==> default: ===============================================
我得到一些错误,当使用命令“刀状态”
/usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- chef/knife/cloud/list_resource_command (LoadError)
from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /h
问题是我需要将Linux命令的值赋给CHef,Attribute.But无法做到。
Im using the below code and not finding the result. Kindly Help what im
missing
ruby_block "something" do
block do
Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
node.default['foo'] = shell_out("echo Hello wor
包含package mod_security或package mod_security2时出现错误Chef: No candidate version available for mod_security2
下面是截取的堆栈跟踪:
* No candidate version available for mod_security2
================================================================================
Error executing action `install
当我试图提供一个新的服务器时,我得到了下面的错误。以前一切都很顺利,所以不知道我为什么要得到这个。这是否是我在使用模板时不能再使用源代码的原因?
NoMethodError
-------------
No resource or method named `source' for `Chef::Recipe "default"'
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/switch/recipes/default.rb:15:in `from_file'
Relevan