Closed baby-gnu closed 2 years ago
Thanks, @baby-gnu. This looks like a nice idea.
This will also necessitate some changes in how the ssf-formula
works, so I'm going to need a little while to get around to this. Currently got a bit of a backlog due to the 3003.2
release, etc.
This will also necessitate some changes in how the
ssf-formula
works, so I'm going to need a little while to get around to this. Currently got a bit of a backlog due to the3003.2
release, etc.
Thanks, it was an idea inspired by a user in SaltStack matrix room, it's not urgent.
@baby-gnu I thought I'd familiarise myself with these changes by adapting it for the salt-formula
. This is the commit I used, which is passing in the CI:
A couple of things I came across so far, which are valid for this PR as well:
pillars: {}
since that's the default provided by kitchen-salt
.top.sls
from being git
added except using -f
:Tested it out with:
$ salt-call --local \
--id test-minion.example.net \
--file-root=./ \
--pillar-root=./test/salt/pillar/ \
--out=yaml \
state.show_sls salt
- There's no need to use
pillars: {}
since that's the default provided bykitchen-salt
.
You are right, I'll remove it on the final rework of this PR
- (I haven't done this in the commit there but) We probably need to remove the following line as well, since it prevents the
top.sls
from beinggit
added expect using-f
:
I'm really not sure, I think we should keep it to avoid having a top.sls
in the states tree, so I propose to use:
top.sls
!test/salt/pillar/top.sls
This way, all top.sls
will be ignored except the test/salt/pillar/top.sls
one.
Thanks for the patience, @baby-gnu -- merged.
Rebased your changes on the latest version of this formula (the CI instances had changed).
The main notes regarding the additional commit:
pillars_from_directories
under provisioner
instead of under suites
, as discussed in the working group meetings.test/salt/pillar/default.sls
instead of test/salt/pillar/defaults.sls
, to maintain consistency with the large number of formulas out there (default
suite has a default.sls
pillar)..travis.yml
and CODEOWNERS
.:tada: This PR is included in version 5.0.4 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
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 fromkitchen.yml
itself by the way)ease the test outside kitchen by running
salt-call
directly with--pillar-root
like:test/salt/pillar/top.sls: limit
gentoo
pillars based onos_family
grain.kitchen.yml (suites): remove the now useless
gentoo
suite. Define an empty requiredpillars
to not override statictop.sls
Definepillars_from_directories
to copy them underpillar_root
.PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
Describe the changes you're proposing
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context