Commit graph

21 commits

Author SHA1 Message Date
Daniel Dehennin
7708e12923
test(pillar): use static test/salt/pillar/top.sls
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`
2021-11-16 21:25:26 +00:00
Imran Iqbal
a2651058be
refactor(service): use systemd-journald instead of systemd-udevd
* The latter is not available on the stripped down pre-salted images
  (for Debian and Ubuntu)
2020-03-23 12:25:33 +00:00
Dafydd Jones
2e8ded6565 refactor: improve reusability using an unique keyword TEMPLATE
BREAKING CHANGE: changed all state names and ids
2019-12-04 23:47:41 +00:00
Imran Iqbal
fde5063e15
docs(pillar.example): fix TOFS comment to explain the default path [skip ci]
* Replace the Jinja brackets to avoid evaluating when `pillar.example` is
  used from Kitchen
* References:
  - https://github.com/saltstack-formulas/libvirt-formula/pull/60#issuecomment-537965254
  - https://github.com/saltstack-formulas/libvirt-formula/pull/60#issuecomment-537988138
2019-10-03 19:25:30 +01:00
Imran Iqbal
27d2fe45dd
docs(pillar.example): improve TOFS comment to explain the default path [skip ci]
* As used in the `nginx-formula`:
  - 17291a0ae2/pillar.example (L340-L341)
2019-10-02 13:30:32 +01:00
Imran Iqbal
e76525f130
feat(yamllint): include for this repo and apply rules throughout
* Semi-automated using `ssf-formula` (v0.5.0)
* Fix errors shown below:

```bash
template-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:")
./test/integration/default/inspec.yml
  1:1       warning  missing document start "---"  (document-start)

./template/osfamilymap.yaml
  1:89      error    line too long (116 > 88 characters)  (line-length)
  1:24      error    trailing spaces  (trailing-spaces)
  13:2      error    syntax error: found character '%' that cannot start any token

pillar.example
  14:4      error    syntax error: found character '%' that cannot start any token
```
2019-08-07 18:27:31 +01:00
Imran Iqbal
c269673295
refactor(tofs): move subcomponent definition to defaults.yaml
* Tests fail locally without modifying pillar otherwise
  - `Jinja variable 'dict object' has no attribute 'subcomponent'`
2019-08-06 11:06:24 +01:00
Daniel Dehennin
c4440d7c55 feat(sub-component): manage a dedicated configuration file
* 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.
2019-07-30 16:17:39 +02:00
Imran Iqbal
3483e760bf
fix(tofs): prepend the config-based source_files to the default
* 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
2019-07-25 02:42:05 +01:00
Daniel Dehennin
13f1728c27 test(libtofs): “tofs.files_switch” lookup can return a list
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.
2019-07-24 12:13:53 +02:00
N
c6ae81cc65
refactor(pkgname): reserve 'pkg' as packaging dict
BREAKING CHANGE: the parameter `pkg` is now a dictionary. References
 to `template.pkg` should be changed to `template.pkg.name`.
2019-06-12 11:48:20 +01:00
Alexander Weidinger
91bc2f046b fix(map.jinja): _merge_ defaults and config.get
test resulting config
2019-05-15 21:27:06 +02:00
Imran Iqbal
a4b1608ab4
feat(centos-6): reshape formula and tests for this platform
* Close #104
2019-05-12 16:22:41 +01:00
Imran Iqbal
51107165f0
fix(tofs): use source_files instead of files
* As discussed in the Slack/IRC/Matrix room from this point forward:
  - https://freenode.logbot.info/saltstack-formulas/20190308#c2046753
2019-03-09 06:36:11 +00:00
Imran Iqbal
3d9a24c71d
fix(tofs): update use of state ID in config and pillar 2019-03-09 01:58:30 +00:00
Imran Iqbal
3f89c12248
fix(pillar): fix os_family typo 2019-02-27 03:55:06 +00:00
Javier Bértoli
e33e68b85d Add a testing scaffold with kitchen-ci, inspec and travis support 2019-02-17 20:59:13 -03:00
Niels Abspoel
775a9309e7 update formula with map.jinja and style guide references, improve README and VERSION 2019-02-10 22:47:43 +01:00
Daniel Dehennin
784ce722ad Switch template.config to TOFS pattern 2019-02-06 16:12:02 +01:00
Forrest
f4651d2037 Fixing pillar to match the map file.
Map file and pillar didn't match.
2014-03-11 08:50:55 -07:00
Lukas Erlacher
528d4166bd Initial commit 2013-11-03 19:50:58 +01:00