为测试厨房添加属性 [英] Adding Attributes to Test Kitchen

查看:13
本文介绍了为测试厨房添加属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 test-kitchenjava 食谱中的属性>.

I'm trying to override attributes in the java cookbook with test-kitchen.

当我尝试运行 kitchen blend 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/ 中.当我点击Go"时,它会删除以attributes"开头的所有行,然后显示绿色的Valid 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"

Getting Started 显示的语法与您的类似:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆