Closed noelmcloughlin closed 2 years ago
@noelmcloughlin The correct answer is probably InSpec Inputs. An example of this is already shown throughout the Kitchen YAML files in the salt-formula
(look for verifier:inputs
). That's a long-winded version, where there had to be inputs for each platform
. When there are general inputs required, they can simply be added in one block under the top-level verifier
key. Here's one example of how to access the input from the actual control.
Yes, so it looks like that solution exists already. Its coupled to kitchen but the file is YAML so could be reused outside kitchen.
I am using molecule test framework for some experiments. Inspec can be used with molecule OR kitchen frameworks, so I was seeking a common way of presenting verifier:inputs
(good terminology) to the verifiers. Kitchen.yaml could be solution as long as inputs could be defined in one block instead of repetition (even if not using kitchen) although needs some thought where the verifier is not Inspec.
Salt would be an excellent verifier for kitchen of course ;-)
Closing.
Salt would be an excellent verifier for kitchen of course ;-)
There's always salt.modules.saltcheck
... there's an example in the cron-formula
.
Is your feature request related to a problem?
I am writing some Inspec tests using saltstack-formulas as a reference and the hard coding of values is anti-pattern which I'm trying to solve. I want to move hard coded values from Inspec Ruby files to YAML and import them dynamically. When something changes I want to update
test\vars.yaml
instead of Ruby strings. Consider two files here:config/vars.yaml:
test/vals.yaml:
After some tests, the Ruby YAML module is good solution I think. We do not need to hard code values as ruby strings if test data is separated from tests.
I think this could work in saltstack-formluas so just raising for discussion.
Describe the solution you'd like
I think this idea will work well in saltstack-formulas too.
Describe alternatives you've considered
I'm using similar pattern using Molecule (ansible verifier) and trying to reuse the pattern with Inspec Verifier
Additional context