The kitchen-salt provisionner have the `pillars_from_directories`
option to recusively copy directories under target pillar root.
This has 3 advantages:
- simplify `kitchen.yml`
- manage pillar assignment with standard salt targetting mechanism,
this avoid the dedicated `gentoo` suite (it could have been done
from `kitchen.yml` itself by the way)
- ease the test outside kitchen by running `salt-call` directly with
`--pillar-root` like:
```
salt-call --local --id test-minion.example.net \
--file-root=template-formula/ \
--pillar-root=template-formula/test/salt/pillar/ \
state.show_sls TEMPLATE
```
* pillar.example: remove settings for testing purpose.
* test/salt/pillar/top.sls: limit `gentoo` pillars based on `os_family`
grain.
* test/salt/pillar/defaults.sls: base pillar dedicated to tests.
* kitchen.yml (suites): remove the now useless `gentoo` suite.
Define `pillars_from_directories` to copy them under `pillar_root`.
Remove useless `pillars_from_files`.
* .gitlab-ci.yml: fix gentoo suite name
* .gitignore: do not ignore test pillar `top.sls`
* pillar.example (template.subcomponent): configurable sub-component
destination.
(template.tofs.source_files): override sub-component template
* template/init.sls (include): setup sub-component last.
* template/clean.sls (include): clean sub-component first.
* template/subcomponent/init.sls: include the only setup state
“config”.
* template/subcomponent/config/init.sls: include the only config state
“file”.
* template/subcomponent/config/file.sls: manage the sub-component
configuration file. It requires the main component configuration.
* template/subcomponent/files/default/subcomponent-example.tmpl.jinja:
jinja template for the sub-component.
* template/subcomponent/files/default/subcomponent-example.tmpl:
static configuration for the sub-component.
* template/subcomponent/clean.sls: include the only cleanup state “config”.
* template/subcomponent/config/clean.sls: remove the sub-component
configuration file.
* https://github.com/saltstack-formulas/nginx-formula/pull/247#issuecomment-514262549
- The main issue is that the `nginx-formula` has dynamic values being
used as the default `source_files` -- there is no way to provide
this from the pillar/config in a sensible fashion
- Prepending to this default (rather than overriding it) resolves this
problem entirely, without adding excessive entries to the `source`
* Closes#151
We need to verify that “libtofs” works when the “tofs.files_switch”
lookup return a list instead of a single element.
* kitchen.yml (provisioner): copy tests specific pillars into the test
environment.
* pillar.example (template.tofs.files_switch): lookup for “roles” at
the end.
* test/salt/pillar/test.sls (roles): list of roles to apply during
tests.
* test/integration/default/controls/config_spec.rb: add “roles” to the
list of “tofs.files_switch” items to verify.