厨师 - 客户不是从厨师 - 客户食谱RHEL 6.7开始

时间:2016-01-20 22:05:26

标签: ruby chef rhel

我正在使用4.3.2厨师 - 客户食谱,厨师 - 客户12.6,我的运行列表是 - 角色厨师 - 客户,我的厨师 - 客户角色如下: 厨师客户端 厨师客户::配置 厨师客户端:: delete_validation

链接到食谱 - https://github.com/chef-cookbooks/chef-client

我的操作系统是rhel 6.7

此外,如果重要,我会在发生此问题时使用Packer创建映像。

我登录到VM,我也无法启动该服务。 在厨师 - 客户端运行期间,将出现以下错误 'mazon-ebs: ================================================================================ amazon-ebs: Error executing action `start` on resource 'service[chef-client]' amazon-ebs: ================================================================================ amazon-ebs: amazon-ebs: Mixlib::ShellOut::ShellCommandFailed amazon-ebs: ------------------------------------ amazon-ebs: Expected process to exit with [0], but received '6' amazon-ebs: ---- Begin output of /sbin/service chef-client start ---- amazon-ebs: STDOUT: amazon-ebs: STDERR: amazon-ebs: ---- End output of /sbin/service chef-client start ---- amazon-ebs: Ran /sbin/service chef-client start returned 6 amazon-ebs: amazon-ebs: Resource Declaration: amazon-ebs: --------------------- amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb amazon-ebs: amazon-ebs: 32: service 'chef-client' do amazon-ebs: 33: supports :status => true, :restart => true amazon-ebs: 34: action [:enable, :start] amazon-ebs: 35: end amazon-ebs: amazon-ebs: Compiled Resource: amazon-ebs: ------------------ amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in `from_file' amazon-ebs: amazon-ebs: service("chef-client") do amazon-ebs: action [:enable, :start] amazon-ebs: updated true amazon-ebs: supports {:status=>true, :restart=>true} amazon-ebs: retries 0 amazon-ebs: retry_delay 2 amazon-ebs: default_guard_interpreter :default amazon-ebs: service_name "chef-client" amazon-ebs: enabled true amazon-ebs: pattern "chef-client" amazon-ebs: declared_type :service amazon-ebs: cookbook_name "chef-client" amazon-ebs: recipe_name "init_service" amazon-ebs: end amazon-ebs: amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: Running queued delayed notifications before re-raising exception amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: template[/etc/init.d/chef-client] sending restart action to service[chef-client] (delayed) amazon-ebs: * service[chef-client] action restart[2016-01-20T16:49:04-05:00] INFO: Processing service[chef-client] action restart (chef-client::init_service line 32) amazon-ebs: amazon-ebs: amazon-ebs: ================================================================================ amazon-ebs: Error executing action `restart` on resource 'service[chef-client]' amazon-ebs: ================================================================================ amazon-ebs: amazon-ebs: Mixlib::ShellOut::ShellCommandFailed amazon-ebs: ------------------------------------ amazon-ebs: Expected process to exit with [0], but received '6' amazon-ebs: ---- Begin output of /sbin/service chef-client restart ---- amazon-ebs: STDOUT: Stopping chef-client: [FAILED] amazon-ebs: STDERR: amazon-ebs: ---- End output of /sbin/service chef-client restart ---- amazon-ebs: Ran /sbin/service chef-client restart returned 6 amazon-ebs: amazon-ebs: Resource Declaration: amazon-ebs: --------------------- amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb amazon-ebs: amazon-ebs: 32: service 'chef-client' do amazon-ebs: 33: supports :status => true, :restart => true amazon-ebs: 34: action [:enable, :start] amazon-ebs: 35: end amazon-ebs: amazon-ebs: Compiled Resource: amazon-ebs: ------------------ amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in from_file amazon-ebs: amazon-ebs: service("chef-client") do amazon-ebs: action [:enable, :start] amazon-ebs: updated true amazon-ebs: supports {:status=>true, :restart=>true} amazon-ebs: retries 0 amazon-ebs: retry_delay 2 amazon-ebs: default_guard_interpreter :default amazon-ebs: service_name "chef-client" amazon-ebs: enabled true amazon-ebs: pattern "chef-client" amazon-ebs: declared_type :service amazon-ebs: cookbook_name "chef-client" amazon-ebs: recipe_name "init_service" amazon-ebs: end amazon-ebs: amazon-ebs:

1 个答案:

答案 0 :(得分:2)

使用chef-client食谱时,您应将其放入运行列表中:chef-client::config, chef-client:init_service

在包含chef-client之前,请避免在运行列表中添加config,因为this will create the service before creating the configuration

因此,请从运行列表中删除chef-client::default(又名chef-client)。这就是全部。如果您愿意,可以使用chef-client::config, chef-client::default, chef-client::delete_validation。但请记住,配置是第一位的。