2017-05-30 188 views
0

來驗證我有以下資源廚師客戶供應方無法與廚師服務器

provisioner "chef" { 
    environment  = "terraform"  
    run_list  = ["cookbook::recipe"] 
    node_name  = "chefclient1"  
    server_url  = "https://1.2.3.4/organizations/terraform" 
    recreate_client = true 
    user_name  = "my_username" 
    user_key  = "${file("chefuser.pem")}" 
    version   = "12.4.1" 
    ssl_verify_mode = "verify_none" 
    connection { 
     user = "ubuntu" 
     private_key = "${file("test.pem")}" 
     agent = "false" 
     timeout = "30s" 
    } 
    } 

一個terraform文件執行時我不斷收到

aws_instance.chefclient (chef): ERROR: Failed to authenticate to https://52.23.2 
43.121/organizations/terraform/ as my_username with key /etc/chef/my_username.pem 
aws_instance.chefclient (chef): Response: Invalid signature for user or client 
'akajain' 

我感到困惑的user_key這裏。這是創建使用

chef-server-ctl user-create test test me [email protected] 'root123' --filename /tmp/chefuser.pem 

或創建的.pem文件organatiosation驗證文件的廚師用戶運行時創建時.pem文件

chef-server-ctl org-create terraform 'Terraform Chef Inc' --association_user test --filename terraform-validator.pem 

回答

0

Username.pem將出現在您的chefrepo/.chef夾。如果您遇到問題,請嘗試重置用戶密鑰並下載新密鑰。它爲我工作。