chef-infra - 使用 Chef 13.6.4 运行 chef-solo 时出错
问题描述
我有一本关于 Chef 12.6 的食谱。在使用 Chef 13.6.4 测试代码时,我收到以下错误:
[root@utah testcookbook ]# chef-solo -c solo.rb -j install_db.json
Starting Chef Client, version 13.6.4
================================================================================
Error expanding the run_list:
================================================================================
Unexpected Error:
-----------------
Chef::Exceptions::ValidationFailed: Option name's value does not match regular expression /^[\-[:alnum:]_]+$/
System Info:
------------
chef_version=13.6.4
platform=oracle
platform_version=7.3
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
program_name=chef-solo worker: ppid=4738;start=12:59:27;
executable=/opt/chef/bin/chef-solo
Running handlers:
[2018-05-07T12:59:31-07:00] ERROR: Running exception handlers
[2018-05-07T12:59:31-07:00] ERROR: Running exception handlers
Running handlers complete
[2018-05-07T12:59:31-07:00] ERROR: Exception handlers complete
[2018-05-07T12:59:31-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 04 seconds
[2018-05-07T12:59:31-07:00] FATAL: Stacktrace dumped to /root/chef/cookbooks/testcookbook/local-mode-cache/cache/chef-stacktrace.out
[2018-05-07T12:59:31-07:00] FATAL: Stacktrace dumped to /root/chef/cookbooks/testcookbook/local-mode-cache/cache/chef-stacktrace.out
[2018-05-07T12:59:31-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-07T12:59:31-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-07T12:59:31-07:00] ERROR: Option name's value does not match regular expression /^[\-[:alnum:]_]+$/
[2018-05-07T12:59:31-07:00] ERROR: Option name's value does not match regular expression /^[\-[:alnum:]_]+$/
[2018-05-07T12:59:31-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2018-05-07T12:59:31-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
这是我的 solo.rb 文件的内容(与 Chef 12.6 一起成功):
[root@utah testdir]# cat solo.rb
cookbook_path '/root/chef/cookbooks'
role_path '/root/chef/cookbooks/testcookbook/roles'
data_bag_path '/root/chef/cookbooks/testcookbook/data_bags'
encrypted_data_bag_secret
'/root/chef/cookbooks/testcookbook/data_bags/data_bag_key'
解决方案
检查 install_db.json 文件,您会在运行列表中错误地分配配方名称。
{
"hostname": {
"run_list": [ "recipe[recipe_name]" ]
}
推荐阅读
- hive - 如何从 hive 获取最新的分区数据
- flutter - Flutter webviews 给出 net::ERR_CACHE_MISS 消息
- c# - 扫描的项目(UWP 应用)不显示在 ListBox 中
- android - 找不到 com.android.tools.build:gradle:2.2.0
- javascript - React Ant 表自定义列计算。如何获取每行中其他项目的长度
- r - 在 R 中绘图时使用点
- regex - 匹配不同情况的特定正则表达式
- sql - 数据库用户是否存储在查询存储中,您能在其中找到数据库用户的 CPU 使用率吗?(SQL Server 管理工作室)
- c++ - QFile 测试 qrc 资源是否存在
- javascript - Chai 测试对象键是否包含在一组键中