Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of pillar namespace flattening? #11599

Closed
thanatos opened this issue Mar 27, 2014 · 1 comment
Closed

Order of pillar namespace flattening? #11599

thanatos opened this issue Mar 27, 2014 · 1 comment
Labels
expected-behavior intended functionality
Milestone

Comments

@thanatos
Copy link

According to the Salt documentation:

The separate pillar files all share the same namespace. Given a top.sls of:

base:
  '*':
    - packages
    - services

a packages.sls file of:

bind: bind9

and a services.sls file of:

bind: named

Then a request for the bind pillar will only return 'named'; the 'bind9' value is not available.

I've attempted to implement this. My top.sls file:

roy1:
  'G@cluster:roy1':
    - match: compound
    - packages
    - services

My packages.sls file:

bind: bind9

My services.sls file:

bind: named

Which I think should match the docs. However, I get:

$ salt foo.example.com saltutil.refresh_pillar
foo.example.com:
    None
$ salt foo.example.com pillar.get bind
foo.example.com:
    bind9

…which is opposite what the docs say I should get.

We're trying to use this functionality to override a pillar value: we define a default for the value in a common.sls in a base tree, (which comes first in the environment) and then in a later tree, try to override it in a custom.sls file. The custom.sls file is listed second, but common.sls appears to win out.

  1. Can the docs reflect what order things get applied in, and be correct?
  2. What's a good way to have a default value specified in an SLS, but be overridable?

(Our salt version is: salt 0.17.1)

@basepi
Copy link
Contributor

basepi commented Mar 28, 2014

Pillar was changed to use OrderedDict objects to retain the top.sls order in a later version than 0.17.1 (I'm not sure exactly which version off the top of my head, but I just tested your example and it works as stated in the docs for the 2014.1 versions of salt (as well as develop) and I also tested on version 0.17.1, where I got the same results as you.

If you'd like the documented behavior, please upgrade to a newer version of salt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expected-behavior intended functionality
Projects
None yet
Development

No branches or pull requests

3 participants