I am new to Salt-Stack wanted to know where are all the dunder dictionaries stored?

For example __salt__, __opts__, __grains__, __beacons__).

  • What do you mean "stored"?
    – OrangeDog
    Commented Sep 12, 2022 at 20:41

1 Answer 1


There are currently 5 dunder dictionaries. They are available at runtime and generally not stored statically.

__opts__ - Master or Minion configuration options; stored in configuration files of master and minion, collected at startup

__salt__ - Execution module functions (i.e. __salt__['test.echo']('foo')); from built-in and custom execution modules stored in _modules/

__grains__ - Grains (i.e. __grains__['os']); collected from minions, dynamically generated, or stored in minion config or /etc/salt/grains

__pillar__ - Pillar data (i.e. __pillar__['foo']); collected from the pillar

__context__ - Context defined in state modules and execution modules

You generally don't need to use them, unless you are developing Salt or writing custom modules, runners, returners, or external pillars.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.