作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我在 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/
我是一名优秀的程序员,十分优秀!