0

Given a pillar top.sls file like this:

base:
  '*': 
     - base
     - local

and a base.sls file like this:

mysetting: 'foo' 

Is there anything you can put in local.sls which will cause mysetting to be undefined again?

Steve Bennett
  • 114,604
  • 39
  • 168
  • 219

1 Answers1

0

The short answer is Probably. See the http://docs.saltstack.com/en/latest/topics/pillar/#pillar-namespace-flattened for more details.

In your particular case having

mysetting: 'boo'

will definitely override! the setting.

I haven't tried it myself but I'm next to confident that the following would set the mysseting to undefined.

mysetting: None
leonardinius
  • 142
  • 1
  • 8
  • Nice idea. I tested it, it doesn't work - the variable just has the value "None", so doesn't work the same as undefined in cases like Jinja's `default()` filter. – Steve Bennett Aug 06 '14 at 03:15
  • @SteveBennett Then the next closes thing what worked when tested locally is `mysetting: ''`. If your states/modules does not explicitly check for `is undefined` - then you are all settled – leonardinius Aug 06 '14 at 13:20
  • @SteveBennett e.g. in my local env `vagrant@fbr-enonic01:~$ sudo salt-call pillar.get mysetting local: ` behaves the same way as for unexisting setting. And `''` still evaluates to `False` in boolean operations. – leonardinius Aug 06 '14 at 13:24
  • Good to know. The main place it matters is Jinja's `default` function, which specifically checks for definedness. http://jinja.pocoo.org/docs/templates/ – Steve Bennett Aug 07 '14 at 05:53