Copy grain matcher to create pillar matcher. #1299
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First, please see the pillars documentation:
http://salt.readthedocs.org/en/latest/topics/pillar/index.html. Next,
perhaps an example will explain this best...
Let's say you have a
/src/pillar/top.sls
that looks like:And a
/srv/pillar/production.sls
that looks like:And a
/srv/pillar/development.sls
that looks like:This means that
/srv/salt/top.sls
could now look like:Both
role
andcountrycode
may also be used as a template variableas explained in the pillar documentation above.
For a real-world example, please see:
This commit also extends the salt command-line client so that it too
may use the pillar matcher, like:
Documentation and tests are not included in this commit. These will
come in a later commit.
The
pillar_match
routine is simply a copy of thegrain_match
routine. But I grep'd for the
exsel
matcher to figure out what partsof the code needed to be touched in order to (hopefully) make this
work. I suppose a pillar pcre matcher could be made just as easily.