ruby – Chef:我可以共享常见的每个环境运行列表项吗?
发布时间:2020-12-17 03:14:01 所属栏目:百科 来源:网络整理
导读:我在厨师中使用环境,我想使用每个环境的运行列表.问题是我不想重复自己(就像我现在所做的那样).例: { "name": "myapp","default_attributes": { },"json_class": "Chef::Role","env_run_lists": { "production": [ # Has less packages because services ar
我在厨师中使用环境,我想使用每个环境的运行列表.问题是我不想重复自己(就像我现在所做的那样).例:
{ "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]","development": [ "role[base]","recipe[myapp]","role[utility]","role[cache]" ] },"run_list": [ ],"description": "The myapp.com core application role","chef_type": "role","override_attributes": { } } 有没有办法可以避免重复这个? "role[base]", 我只是想避免环境运行列表不同步和破坏部署. 解决方法
这个时候没有.角色纯粹是声明性的,而不是那种动态的.您可以创建一个包含这三个项目的角色,并将其包含在每个环境运行列表中.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |