.kitchen.yml:
platforms:
- name: win2012r2
suites:
- name: example
Is it possible to get the running platform or suite name from within a recipe? I've tried node['platform']
and node['suite']
but both are empty.
.kitchen.yml:
platforms:
- name: win2012r2
suites:
- name: example
Is it possible to get the running platform or suite name from within a recipe? I've tried node['platform']
and node['suite']
but both are empty.
node['name']
evaluates to the suite name plus platform name joined by a hyphen (e.g. example-win2012r2
).
you can use ohai:
Ohai is a tool that is used to collect system configuration data, which is provided to the chef-client for use within cookbooks.
you can have ohai load as a part of the ohai cookbook and then leverage it to retrieve the desired information. such as
node['platform']
node['platform_family']
node['kernel']['os']