Test-kitchen: how to read platform specific attributes in kitchen.yml

In my configuration, .kitchen.yml

I am trying to apply attributes depending on the platform version. My kitchen config looks like this:

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"

      

In the process, kitchen converge

I cannot get the value correctly pg_version

. For this code, in my chef script, the pp node.debug_value('pg_version')

output is as follows:

   [["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]]

      

I don't understand this result. I am assuming that the priority level of the attribute specified in the platforms

yml section is equal normal

, so how can I get it?

User danieljimenez also raised a similar question here .

+3


source to share


1 answer


Different levels of priority are combined into one object node

. You will want to access it using node['pg_version']

in your case. When set you only need node.default

, node.set

, node.override

.



+2


source







All Articles