From a10e09d758444af1b03631d5855695c0422661e1 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sat, 7 Sep 2019 22:52:01 +0100 Subject: [PATCH] feat(inspec.yml): add `depends` handling --- ssf/defaults.yaml | 1 + ssf/files/default/inspec/inspec.yml | 13 +++++++++++++ ssf/files/default/kitchen.yml | 1 + 3 files changed, 15 insertions(+) diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index 8aac43ac..7c9b4bb2 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -32,6 +32,7 @@ ssf_node_anchors: excludes: [] includes: [] inspec_yml: + depends: [] summary: >- Verify that the formula is setup and configured correctly supports: diff --git a/ssf/files/default/inspec/inspec.yml b/ssf/files/default/inspec/inspec.yml index c58a6d2f..ba405577 100644 --- a/ssf/files/default/inspec/inspec.yml +++ b/ssf/files/default/inspec/inspec.yml @@ -11,6 +11,19 @@ license: Apache-2.0 # yamllint disable-line rule:line-length {%- endif %} {{ summary_heading }}{{ suite.inspec_yml.summary }} +{#- Centralise duplication from here and `kitchen.yml` #} +{%- set depends = suite.inspec_yml.depends %} +{%- if depends %} +depends: + {%- for depend in depends %} + - name: {{ depend.name }} + {%- for k, v in depend.items() %} + {%- if k != 'name' %} + {{ k }}: {{ v }} + {%- endif %} + {%- endfor %} + {%- endfor %} +{%- endif %} supports: {%- for platform in suite.inspec_yml.supports %} - platform-name: {{ platform }} diff --git a/ssf/files/default/kitchen.yml b/ssf/files/default/kitchen.yml index 07a778c6..83ad0728 100644 --- a/ssf/files/default/kitchen.yml +++ b/ssf/files/default/kitchen.yml @@ -184,6 +184,7 @@ suites: {%- endfor %} {%- endif %} {#- dependencies #} + {#- Centralise duplication from here and `inspec.yml` #} {%- set dependencies = suite.provisioner.dependencies %} {%- if dependencies %} dependencies: