在chef-solo中使用环境作为包装工

时间:2018-06-19 15:11:59

标签: azure chef-solo packer

我需要使用预配器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]"
        ]
    }
]}

在角色中,我有需要食谱的环境。我如何在这里定义环境?

1 个答案:

答案 0 :(得分:0)

尝试一下:

{
"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”中正确定义的环境之一。

致谢