向测试厨房添加属性 [英] Adding Attributes to Test Kitchen
本文介绍了向测试厨房添加属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用覆盖 java
食谱中的属性test-kitchen 。
I'm trying to override attributes in the java
cookbook with test-kitchen.
当我尝试运行 kitchen converge default-centos-64
时,出现YAML错误。
When I try run kitchen converge default-centos-64
, a bad YAML error shows up.
---
driver:
name: vagrant
customize:
memory: 1024
cpuexecutioncap: 50
provisioner:
name: chef_solo
platforms:
- name: centos-6.4
suites:
- name: default
run_list:
- recipe[java::default]
- recipe[maven::default]
attributes: {
java.install_flavor: "oracle",
java.jdk_version: "7"
}
我将以上内容粘贴到 http://yamllint.com/ 中。当我点击开始时,它将删除所有从属性开始的行,然后显示绿色的有效YAML。
I pasted the above into http://yamllint.com/. When I hit "Go," it removes all lines beginning at "attributes", and then shows a Green "Valid YAML".
推荐答案
属性以常规Yaml内容形式提供:
Attributes are supplied as normal yaml content:
suites:
- name: default
run_list:
- recipe[java::default]
- recipe[maven::default]
attributes:
java:
install_flavor: "oracle",
jdk_version: "7"
入门显示的语法类似于您的语法:
The Getting Started shows a syntax similar to yours:
suites:
- name: default
run_list:
- recipe[java::default]
- recipe[maven::default]
attributes: { 'java': { 'install_flavor': 'oracle' } }
这篇关于向测试厨房添加属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文