【发布时间】:2015-06-10 05:50:20
【问题描述】:
在我的.kitchen.yml 配置中,我尝试根据平台版本应用属性。我的厨房配置如下:
platforms:
- name: centos-6.3
driver_plugin: ec2
driver:
image_id: ami-xxxxxxxx
attributes:
pg_version: "9.3"
- name: centos-6.5
driver_plugin: ec2
driver:
image_id: ami-yyyyyyyy
attributes:
pg_version: "9.4"
在kitchen converge 过程中,我无法正确获取pg_version 值。对于我的厨师脚本pp node.debug_value('pg_version') 中的这段代码,输出如下:
[["set_unless_enabled?", false],
["default", :not_present],
["env_default", :not_present],
["role_default", :not_present],
["force_default", :not_present],
["normal", "9.4"],
["override", :not_present],
["role_override", :not_present],
["env_override", :not_present],
["force_override", :not_present],
["automatic", :not_present]]
我不清楚这个结果。我假设我在platforms yml 部分中指定的属性的优先级是normal,那么我怎样才能得到它呢?
用户danieljimenez也提出了类似的问题here。
【问题讨论】:
-
您能告诉我们您是如何访问该属性的吗?我希望它在
node['pg_version']。 -
@Martin 刚刚更新
-
@Martin 这是否意味着所有平台属性默认为
normal优先级,我们需要像node.normal['pg_version']一样使用smth?
标签: amazon-ec2 chef-infra test-kitchen chefdk