【问题标题】:How to specify chef_environment for chef local mode (chef-client -z)如何为厨师本地模式指定 chef_environment (chef-client -z)
【发布时间】:2015-01-17 01:38:40
【问题描述】:

我已将厨师文件从厨师服务器复制到本地客户端节点,在~/.chef 下,我在~/.chef/environments 下拥有所有环境,例如development.rbproduction.rb

当我从~/.chef/ 下运行chef-client -z -E development -r 'recipe[cookbook_foo::recipe_bar]' 时,我收到此错误:

================================================================================
Error expanding the run_list:
================================================================================

Unexpected API Request Failure:
-------------------------------
Object not found: http://localhost:8889/environments/development

如果我在没有-E development 的情况下运行命令,一切正常。但是,我需要传递环境名称,因为该厨师食谱中使用了 #{node.chef_environment} 变量。谷歌没有为我提供这个问题的答案:/

我正在使用 Chef 客户端 11.16.4

有什么想法吗?

【问题讨论】:

    标签: chef-infra chef-zero


    【解决方案1】:

    很遗憾,Chef Zero 不理解 .rb DSL 文件。您需要将环境文件转换为 .json 才能与 Chef Zero 一起使用。

    【讨论】:

    • 非常感谢!我转换了文件,现在一切正常! :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-18
    相关资源
    最近更新 更多