设置chef-shell时出错

时间:2017-05-25 04:53:11

标签: chef

我正在尝试第一次设置厨师外壳。 我在knife.rb的相同路径中创建了chef_shell.rb,并将" node_name",client_key和chef_server_url的值从knife.rb复制到chef_shell.rb。

当我从chef-shell -z目录运行.chef时,出现此错误。 有什么帮助吗?

.......Creating a new client identity for Username-MacBook-Pro.local using the validator key.

================================================================================
Chef encountered an error attempting to create the client "Username-MacBook-Pro.local"
================================================================================

Platform:
---------
x86_64-darwin13

epic fail!

/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/api_client/registration.rb:74:in `assert_destination_writable!': I can't write your private key to /etc/chef/client.pem - check permissions? (Chef::Exceptions::CannotWritePrivateKey)
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/api_client/registration.rb:54:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/client.rb:620:in `register'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/shell/shell_session.rb:219:in `rebuild_node'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/shell/shell_session.rb:55:in `block in reset!'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/shell/shell_session.rb:101:in `loading'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/shell/shell_session.rb:54:in `reset!'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/shell.rb:127:in `session'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/shell.rb:136:in `init'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/lib/chef/shell.rb:65:in `start'
    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/bin/chef-shell:34:in `<top (required)>'
    from /usr/local/bin/chef-shell:57:in `load'
    from /usr/local/bin/chef-shell:57:in `<main>'

1 个答案:

答案 0 :(得分:0)

它说

  

我无法将您的私钥写入/etc/chef/client.pem - 检查权限?

所以它似乎没有获取私钥的设置。您确定它会查找chef_shell.rb吗?

有疑问的尝试

chef-shell -c chef_shell.rb -z