0
我想使用chef_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_key
爲"/tmp/vagrant-chef/validation.pem"
,而不是選擇living.pem
文件我已經上Vagrantfile
設置:
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 Server上創建了雲(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"]
,然後我進行knife ssl check
:
Connecting to host api.chef.io:443
Successfully verified certificates from `api.chef.io'
'chef.validation_key_path ='living.pem'' <=也許嘗試指定一個完整的路徑? Vagrant會將'/ tmp/vagrant-chef'下的所有必要文件複製到創建的虛擬機中,並從那裏運行主廚,因爲您沒有指定完整路徑,所以我不能複製正確的主鍵。 – Tensibai
謝謝@Tensibai。我在設置完整路徑之前測試了它。儘管如此,它仍然失敗(信息是一樣的)。一個'validation.pem'文件被複制到'temp/vagrant-chef'中... – Jordi
我的意思是這個路徑是相對於你的主機,使用你的實際位置的完整路徑而不是VM機器。 – Tensibai