我正在进行一些自动化来构建我的裸机主机。自动化通过kickstart脚本安装CentOS 7.3,通过运行一些kickstart后安装脚本来完成。其中一个脚本执行必要的工作来安装Chef包,复制我需要的证书,生成适当的文件,将组织加入节点,将其放置在适当的环境和角色中,然后最终运行chef-client。
一切似乎都在起作用,直到我运行我的chef-client --once命令,这是第一次运行失败。当我在事后手动登录到盒子并运行一个手动厨师 - 客户端时,我没有问题,运行得很好。我的运行列表中唯一的东西是chef-client :: default和chef-client :: config。厨师版本19.33.36。
以下是bash代码片段,其中我引导到我的org然后运行chef-client:
cd /opt/chef/bin/
chef-client -c /etc/chef/client.rb
echo "---------------------------------------" >> /tmp/build.log
echo "chef-client -c /etc/chef/client.rb" >> /tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
(cd /etc/chef && /usr/bin/knife node environment set $HOST $CHEF_ENV)
echo "---------------------------------------" >> /tmp/build.log
echo "/usr/bin/knife node environment set $HOST $CHEF_ENV" >> /tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
(cd /etc/chef && /usr/bin/knife node run_list set $HOST role[$CHEF_ROLE])
echo "---------------------------------------" >> /tmp/build.log
echo "/usr/bin/knife node run_list set $HOST role[$CHEF_ROLE]" >>
/tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
CHEF_RUN_OUTPUT=`chef-client --once`
echo "---------------------------------------" >> /tmp/build.log
echo "chef-client --once" >> /tmp/build.log
echo "---------------------------------------" >> /tmp/build.log
echo $CHEF_RUN_OUTPUT >> /tmp/build.log
以下是我的帖子脚本完成后发生的事情的日志:
来自/var/log/chef/client.log:
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/run/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: directory[/var/run/chef] created directory /var/run/chef
[2017-08-18T10:51:51-05:00] INFO: directory[/var/run/chef] owner changed to 0
[2017-08-18T10:51:51-05:00] INFO: directory[/var/run/chef] group changed to 0
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/cache/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: directory[/var/cache/chef] created directory /var/cache/chef
[2017-08-18T10:51:51-05:00] INFO: directory[/var/cache/chef] owner changed to 0
[2017-08-18T10:51:51-05:00] INFO: directory[/var/cache/chef] group changed to 0
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/lib/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: directory[/var/lib/chef] created directory /var/lib/chef
[2017-08-18T10:51:51-05:00] INFO: directory[/var/lib/chef] owner changed to 0
[2017-08-18T10:51:51-05:00] INFO: directory[/var/lib/chef] group changed to 0
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/var/log/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: Processing directory[/etc/chef] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: Processing template[/etc/sysconfig/chef-client] action create (chef-client::systemd_service line 27)
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] created file /etc/sysconfig/chef-client
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] updated file contents /etc/sysconfig/chef-client
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] mode changed to 644
[2017-08-18T10:51:51-05:00] INFO: Processing systemd_unit[chef-client.service] action create (chef-client::systemd_service line 56)
[2017-08-18T10:51:51-05:00] INFO: Processing file[/etc/systemd/system/chef-client.service] action create (dynamically defined)
[2017-08-18T10:51:51-05:00] INFO: Running queued delayed notifications before re-raising exception
[2017-08-18T10:51:51-05:00] INFO: template[/etc/sysconfig/chef-client] sending restart action to service[chef-client] (delayed)
[2017-08-18T10:51:51-05:00] INFO: Processing service[chef-client] action restart (chef-client::systemd_service line 62)
[2017-08-18T10:51:51-05:00] INFO: service[chef-client] restarted
[2017-08-18T10:51:51-05:00] ERROR: Running exception handlers
[2017-08-18T10:51:51-05:00] ERROR: Exception handlers complete
[2017-08-18T10:51:51-05:00] INFO: Sending resource update report (run-id: 2a04bb13-bd0e-4fec-b6e0-093bd0bb3ab7)
[2017-08-18T10:51:51-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-08-18T10:51:51-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-08-18T10:51:51-05:00] ERROR: systemd_unit[chef-client.service] (chef-client::systemd_service line 56) had an error: Chef::Exceptions::ValidationFailed: file[/etc/systemd/system/chef-client.service] (dynamically defined) had an error: Chef::Exceptions::ValidationFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000028b2200>
[2017-08-18T10:51:51-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
来自chef-stacktrace.out:
>>>> Caused by Chef::Exceptions::ValidationFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000028b2200>
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:352:in `block in do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:350:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:350:in `do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/file.rb:151:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/systemd_unit.rb:198:in `manage_unit_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/systemd_unit.rb:60:in `block in action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider.rb:176:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider/systemd_unit.rb:59:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:69:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:97:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:97:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:97:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/runner.rb:96:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:670:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:665:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:665:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:704:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/client.rb:284:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:295:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:283:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:283:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:248:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:236:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application/client.rb:450:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application/client.rb:450:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application/client.rb:434:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.33/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:57:in `load'
添加chef-client -l调试级别日志以进行进一步分析:
[2017-08-23T11:11:19-05:00] DEBUG: Initiating POST to https://chef001/organizations/baremetal-sh-npe/reports/nodes/node/runs/61604df2-38ea-4d3d-9be3-3d93ef8187bc
[2017-08-23T11:11:19-05:00] DEBUG: ---- HTTP Request Header Data: ----
[2017-08-23T11:11:19-05:00] DEBUG: X-Ops-Reporting-Protocol-Version: 0.1.0
[2017-08-23T11:11:19-05:00] DEBUG: Content-Encoding: gzip
[2017-08-23T11:11:19-05:00] DEBUG: X-Ops-Server-API-Version: 1
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.1;
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-USERID: t9301bmh1001
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-TIMESTAMP: 2017-08-23T16:11:19Z
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-CONTENT-HASH: khFZ3GcjogWXzfxs5/c8VQOIK/0=
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-1: A3v+4H3vj4baFTprTLXLW9rEUP5qOSu95VC3oXJi8A0GUPqP8D1JK+Fn4C/k
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-2: Mksf+LkEIyV+RpNZ/qoRUFeKk90HIViK6+bU31GAkZLArr0aNJHEaBQTOmq7
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-3: zEWHWKHPDdw7coQ4VSi/uqQML20K2fSB5e5mRffnqdHu8cYafmzOEXM/dBcR
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-4: ozK/ATHfxqK/h3PpEdetfNDRsoLF3z2dsNeBepArtOkpVbi900UkANib1CFD
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-5: K4nMY8HbS6SLAjzwZR9+k6WojXwM5Ea5w5o5QKfAvLyAvQJjjOBRh1IIPC+m
[2017-08-23T11:11:19-05:00] DEBUG: X-OPS-AUTHORIZATION-6: mnggHfPZWY3Nat12n6DVR/dFz+xStrPe7P799ZHivA==
[2017-08-23T11:11:19-05:00] DEBUG: HOST: chef001.target.com:443
[2017-08-23T11:11:19-05:00] DEBUG: X-REMOTE-REQUEST-ID: 61604df2-38ea-4d3d-9be3-3d93ef8187bc
[2017-08-23T11:11:19-05:00] DEBUG: Content-Length: 2092
[2017-08-23T11:11:19-05:00] DEBUG: ---- End HTTP Request Header Data ----
[2017-08-23T11:11:19-05:00] DEBUG: ---- HTTP Status and Header Data: ----
[2017-08-23T11:11:19-05:00] DEBUG: HTTP 1.1 200 OK
[2017-08-23T11:11:19-05:00] DEBUG: server: openresty/1.11.2.1
[2017-08-23T11:11:19-05:00] DEBUG: date: Wed, 23 Aug 2017 16:11:19 GMT
[2017-08-23T11:11:19-05:00] DEBUG: content-type: application/json
[2017-08-23T11:11:19-05:00] DEBUG: content-length: 2
[2017-08-23T11:11:19-05:00] DEBUG: connection: close
[2017-08-23T11:11:19-05:00] DEBUG: ---- End HTTP Status/Header Data ----
[2017-08-23T11:11:19-05:00] DEBUG: Audit Reports are disabled. Skipping sending reports.
[2017-08-23T11:11:19-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-08-23T11:11:19-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-08-23T11:11:19-05:00] DEBUG: Chef::Exceptions::ValidationFailed: systemd_unit[chef-client.service] (chef-client::systemd_service line 56) had an error: Chef::Exceptions::ValidationFailed: file[/etc/systemd/system/chef-client.service] (dynamically defined) had an error: Chef::Exceptions::Valida tionFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000063fa808>
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:352:in `block in do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:151:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:198:in `manage_unit_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:60:in `block in action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:176:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:59:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:69:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:96:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:670:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:665:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:665:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:704:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:284:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:295:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:248:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:236:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:434:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:57:in `load'
/usr/bin/chef-client:57:in `<main>'
>>>> Caused by Chef::Exceptions::ValidationFailed: Proposed content for /etc/systemd/system/chef-client.service failed verification #<Chef::Resource:: File::Verification:0x000000063fa808>
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:352:in `block in do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:350:in `do_validate_content'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/file.rb:151:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:198:in `manage_unit_file'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:60:in `block in action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:176:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/systemd_unit.rb:59:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:145:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource.rb:622:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:69:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `each'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:96:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:670:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:665:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:665:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:704:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:284:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:295:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:248:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:236:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:434:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:57:in `load'
/usr/bin/chef-client:57:in `<main>'
[2017-08-23T11:11:19-05:00] ERROR: systemd_unit[chef-client.service] (chef-client::systemd_service line 56) had an error: Chef::Exceptions::Validation Failed: file[/etc/systemd/system/chef-client.service] (dynamically defined) had an error: Chef::Exceptions::ValidationFailed: Proposed content for /et c/systemd/system/chef-client.service failed verification #<Chef::Resource::File::Verification:0x000000063fa808>
[2017-08-23T11:11:20-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
关于为什么我的第一次奔跑南下的任何想法?我的目的是让节点放在它的适当的env和角色中,然后让盒子运行与env / role相关的所有适当的配方。
谢谢!
答案 0 :(得分:0)
您需要使用完整路径,但只需使用knife bootstrap
,它就可以解决此问题。