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".
Test Kitchen is Chef's integrated testing framework. It enables writing test recipes, which will run on the VMs once they are instantiated and converged using the cookbook. The test recipes run on that VM and can verify if everything works as expected. ChefSpec is something which only simulates a Chef run.
Kitchen is a testing framework provided by chef. kitchen. yml is a fairly simple file. Its purpose is to provide configurations for the kitchen setup.
A converge will leave the machine running and kitchen automatically uploads changes each converge so that one can iterate rapidly on configuration code. A lot of time and effort has gone into ensuring that the exit code of kitchen is always appropriate.
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' } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With