Chef infra 厨师长:流浪汉的客户端身份验证问题

Chef infra 厨师长:流浪汉的客户端身份验证问题,chef-infra,Chef Infra,我正在尝试使用chef\u client作为供应者。目前,我收到以下信息: ==> default: ================================================================================ ==> default: Chef encountered an error attempting to create the client "vagrant-3ccfff14" ==> default: ======

我正在尝试使用
chef\u client
作为供应者。目前,我收到以下信息:

==> default: ================================================================================
==> default: Chef encountered an error attempting to create the client "vagrant-3ccfff14"
==> default: ================================================================================
==> default:
==> default: Authentication Error:
==> default: ---------------------
==> default: Failed to authenticate to the chef server (http 401).
==> default:
==> default: Server Response:
==> default: ----------------
==> default: Invalid signature for user or client 'living-digital-validator'
==> default:
==> default: Relevant Config Settings:
==> default: -------------------------
==> default: chef_server_url         "https://api.chef.io/..."
==> default: validation_client_name  "living-digital-validator"
==> default: validation_key          "/tmp/vagrant-chef/validation.pem"
==> default:
==> default: If these settings are correct, your validation_key may be invalid.
==> default:
==> default: Platform:
==> default: ---------
==> default: x86_64-linux
==> default:
它正在尝试选择
validation\u键作为
“/tmp/vagrant chef/validation.pem”
,而不是选择我在
vagrant文件上设置的
living.pem
文件:

config.vm.provision "chef_client" do |chef|
    chef.add_recipe 'custom_recipe'
    chef.chef_server_url = 'https://api.chef.io/...'
    chef.validation_key_path = 'living.pem'
    chef.validation_client_name = 'living-digital-validator'
end
我正在使用一个我刚刚在Chef服务器上创建的帐户作为云(Chef Manage)

为什么它选择了一个
pem
而不是我设置的
Vagranfile

我已经创建了一个
knife.rb
文件,该文件包含以下内容:

current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "living"
client_key               "#{current_dir}/living.pem"
chef_server_url          "https://api.chef.io/..."
cookbook_path            ["#{current_dir}/../cookbooks"]
然后我执行了
检查

Connecting to host api.chef.io:443
Successfully verified certificates from `api.chef.io'

这意味着您的验证客户端名称或密钥(可能是后者)不正确。您可以通过Chef Web UI或
knife客户端重新设置密钥

Chef.validation\u key\u path='living.pem'
谢谢@Tensibai。在设置完整路径之前,我测试了它。然而,它总是失败(消息是一样的)。
validation.pem
文件被复制到
temp/vagrant chef
…我的意思是,此路径是相对于主机的,请使用此文件的实际位置的完整路径,而不是虚拟机。是的,是的。我已尝试设置托管的
living.pem
的完整路径。所以,我在一台windows机器上工作,我尝试了
D:\projects\living\vagrant\production\centos\living.pem
。这个
living.pem
文件位于
Vagrantfile
所在的位置。我的意思是
validation.pem
文件被复制到
/tmp/vagrant chef
中,内容为
living.pem
。这可能是与
验证\u客户端\u名称相关的问题