使用Chef 13.6.4

时间:2018-05-07 20:16:29

标签: chef chef-solo

我有一本关于厨师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'

1 个答案:

答案 0 :(得分:0)

检查install_db.json文件,您会在运行列表中错误地分配了配方名称。

{
 "hostname": {
 "run_list": [ "recipe[recipe_name]" ]
}