在 chef-solo 中为 packer 使用环境
Use environment in chef-solo for packer
我需要使用 provisioner chef-solo 在 Azure 中通过打包器创建映像。
{
"builders": [{ ... }]
"provisioners": [
{
"type": "chef-solo",
"cookbook_paths": ["C:/Users/User/workplace/Git/Chef/cookbooks"],
"environments_path": "C:/Users/User/workplace/Git/Chef/environment",
"roles_path": "C:/Users/User/workplace/Git/Chef/roles",
"run_list": [
"role[es601-master]"
]
}
]}
在角色中,我拥有包含所需食谱的环境。我如何在这里定义环境?
试试这个:
{
"builders": [{ ... }]
"provisioners": [
{
"type": "chef-solo",
"cookbook_paths": ["C:/Users/User/workplace/Git/Chef/cookbooks"],
"environments_path": "C:/Users/User/workplace/Git/Chef/environment",
"roles_path": "C:/Users/User/workplace/Git/Chef/roles",
"run_list": [
"role[es601-master]"
],
"chef_environment": "dev"
}
]}
确保键 "chef_environment" 的值必须是您在 "C:/Users/User/workplace/Git/Chef/environment"
中正确定义的环境之一
此致
我需要使用 provisioner chef-solo 在 Azure 中通过打包器创建映像。
{
"builders": [{ ... }]
"provisioners": [
{
"type": "chef-solo",
"cookbook_paths": ["C:/Users/User/workplace/Git/Chef/cookbooks"],
"environments_path": "C:/Users/User/workplace/Git/Chef/environment",
"roles_path": "C:/Users/User/workplace/Git/Chef/roles",
"run_list": [
"role[es601-master]"
]
}
]}
在角色中,我拥有包含所需食谱的环境。我如何在这里定义环境?
试试这个:
{
"builders": [{ ... }]
"provisioners": [
{
"type": "chef-solo",
"cookbook_paths": ["C:/Users/User/workplace/Git/Chef/cookbooks"],
"environments_path": "C:/Users/User/workplace/Git/Chef/environment",
"roles_path": "C:/Users/User/workplace/Git/Chef/roles",
"run_list": [
"role[es601-master]"
],
"chef_environment": "dev"
}
]}
确保键 "chef_environment" 的值必须是您在 "C:/Users/User/workplace/Git/Chef/environment"
中正确定义的环境之一此致