gpt4 book ai didi

chef-infra - 无法在带有 Chef 客户端的本地模式下找到 Recipe

转载 作者:行者123 更新时间:2023-12-01 14:35:35 27 4
gpt4 key购买 nike

我是 Chef 的新手,正在学习一个教程,该教程提供有关在食谱或特定食谱中运行默认食谱的信息。我的食谱的树输出如下:

pwd
/opt/dk-chef/python_code/Chef
[root@LUMOS Chef]# tree Cookbooks/BasicLinux/
Cookbooks/BasicLinux/
├── Berksfile
├── chefignore
├── LICENSE
├── metadata.rb
├── nodes
│   └── LUMOS.RMT.com.json
├── README.md
├── recipes
│   ├── default.rb
│   ├── nodes
│   │   └── LUMOS.RMT.com.json
│   └── setup.rb
├── spec
│   ├── spec_helper.rb
│   └── unit
│   └── recipes
│   └── default_spec.rb
└── test
└── smoke
└── default
└── default_test.rb

如下运行 Chef-client 命令告诉我 Cookbook 总是丢失。是否需要设置配置参数才能找到食谱?
chef-client -z -r "recipe[BasicLinux::setup]"
[2017-12-21T15:18:20-05:00] WARN: No config file found or specified on command line, using command line options.
[2017-12-21T15:18:20-05:00] WARN: No cookbooks directory found at or above current directory. Assuming /opt/dk-chef/python_code/Chef.
[2017-12-21T15:18:20-05:00] WARN: No cookbooks directory found at or above current directory. Assuming /opt/dk-chef/python_code/Chef.
Starting Chef Client, version 13.6.4
resolving cookbooks for run list: ["BasicLinux::setup"]

================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
No such cookbook: BasicLinux

Expanded Run List:
------------------
* BasicLinux::setup

System Info:
------------
chef_version=13.6.4
platform=redhat
platform_version=6.6
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
program_name=chef-client worker: ppid=23170;start=15:18:20;
executable=/opt/chefdk/bin/chef-client


Running handlers:
[2017-12-21T15:18:23-05:00] ERROR: Running exception handlers
[2017-12-21T15:18:23-05:00] ERROR: Running exception handlers
Running handlers complete
[2017-12-21T15:18:23-05:00] ERROR: Exception handlers complete
[2017-12-21T15:18:23-05:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 03 seconds
[2017-12-21T15:18:23-05:00] FATAL: Stacktrace dumped to /root/.chef/local-mode-cache/cache/chef-stacktrace.out
[2017-12-21T15:18:23-05:00] FATAL: Stacktrace dumped to /root/.chef/local-mode-cache/cache/chef-stacktrace.out
[2017-12-21T15:18:23-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-12-21T15:18:23-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-12-21T15:18:23-05:00] ERROR: 412 "Precondition Failed"
[2017-12-21T15:18:23-05:00] ERROR: 412 "Precondition Failed"
[2017-12-21T15:18:23-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2017-12-21T15:18:23-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

最佳答案

1.创建名为“cookbooks”的目录并将您的cookbook放入(或创建)该目录中
2.从cookbooks 目录的外部,启动您的或以下命令。
须藤厨师客户端 -z --runlist "your_cookbook_name::your_recipe_name"

关于chef-infra - 无法在带有 Chef 客户端的本地模式下找到 Recipe ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47932215/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com