gpt4 book ai didi

ruby - Chef : Can I share common per-environment run list items?

转载 作者:数据小太阳 更新时间:2023-10-29 07:16:21 25 4
gpt4 key购买 nike

我在 Chef 中使用环境,我想使用每个环境的运行列表。问题是我不想重复自己(就像我现在做的那样)。示例:

{
"name": "myapp",
"default_attributes": {
},
"json_class": "Chef::Role",
"env_run_lists": {
"production": [
# Has less packages because services are spread across specialized nodes
"role[base]",
"recipe[mysql::client]",
"recipe[myapp]"
],
"staging": [
# Has less packages because services are spread across specialized nodes
"role[base]",
"recipe[mysql::client]",
"recipe[myapp]"
],
"development": [
"role[base]",
"recipe[mysql::client]",
"recipe[myapp]",
"role[utility]",
"role[cache]"
]
},
"run_list": [

],
"description": "The myapp.com core application role",
"chef_type": "role",
"override_attributes": {

}
}

有什么方法可以避免重复此操作?

      "role[base]",
"recipe[mysql::client]",
"recipe[myapp]",

我只想避免环境运行列表不同步和破坏部署。

最佳答案

目前,没有。角色纯粹是声明性的,而不是动态的。您可以创建一个包含这三项的角色,并将其包含在每个环境的运行列表中。

关于ruby - Chef : Can I share common per-environment run list items?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9688959/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com