Adding Attributes to Test Kitchen

眉间皱痕 提交于 2019-11-30 03:21:37

问题


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

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"
                }

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".


回答1:


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' } }


来源:https://stackoverflow.com/questions/23224384/adding-attributes-to-test-kitchen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!