我按照本指南http://docs.ansible.com/ansible/gce_module.htmlAnsible提供Google Compute Engine的JSON憑證文件在哪裏?
它表示credentials_file
JSON格式可以被用來代替過時的pem_file
。我在哪裏可以得到這個憑據文件?
我按照本指南http://docs.ansible.com/ansible/gce_module.htmlAnsible提供Google Compute Engine的JSON憑證文件在哪裏?
它表示credentials_file
JSON格式可以被用來代替過時的pem_file
。我在哪裏可以得到這個憑據文件?
轉到Developers Console Credentials頁面。 從項目下拉列表中選擇您的項目。 在Credentials頁面上,選擇Create credentials下拉菜單,然後選擇Service account key。 從服務帳戶下拉列表中選擇一個現有的服務帳戶或創建一個新帳戶。 對於鍵類型,請選擇JSON密鑰選項,然後選擇創建。該文件自動下載到您的計算機。 將剛剛下載的* .json文件放入您選擇的目錄中。這個目錄必須是私有的(你不能讓任何人訪問這個目錄),但是你的web服務器代碼可以訪問它。
將環境變量設置爲下載的JSON文件的路徑。
https://developers.google.com/identity/protocols/application-default-credentials#howtheywork
嘗試生成該文件與本教程---> https://developers.google.com/identity/protocols/application-default-credentials#howtheywork –
謝謝@Raul。我有這個文件。 – trex