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

document "magic" objects such as __salt__ #1075

Closed
SEJeff opened this issue Apr 11, 2012 · 5 comments
Closed

document "magic" objects such as __salt__ #1075

SEJeff opened this issue Apr 11, 2012 · 5 comments
Labels
Documentation Relates to Salt documentation stale
Milestone

Comments

@SEJeff
Copy link
Contributor

SEJeff commented Apr 11, 2012

This issue is two-fold. We need to document the special objects available in state files for users (such as salt, grains, etc) and the ones available inside of modules or state python modules such as __salt__, _opts_, _env_, etc.

The ability to reference grains via grains['os'] or invoke salt modules via salt['user.info]('foouser') in a state file is very powerful and should be well documented.

@thatch45
Copy link
Contributor

I agree, thanks!
I think that doing a full docs sweep for 1.0.0 will be wise

@SEJeff
Copy link
Contributor Author

SEJeff commented Apr 11, 2012

It was dcolish's idea, but it does need to be done.

@whiteinge
Copy link
Contributor

There's scattered documentation nowadays but I think this could still use some focus. Adding to the documentation sprint focus...

Refs #12446.

@whiteinge
Copy link
Contributor

Quick checklist:

  • Execution modules & State modules function-level injected variables: __salt__, __grains__, __opts__, __pillar__, __env__.
  • Execution module magic module-level functions and vars: __virtual__(), __virtualname__, __init__().
  • Available Jinja context in States: salt, grains, pillar, opts, env, sls.
  • Available Jinja context in file.managed templated files: (all the args in the actual file.managed state itself).
  • Available Jinja context in Reactor files: data.
  • Magic variables in State modules: __running__, __low__, __lowstate__, __context__.
  • Injected variables in runner modules: __opts__ (master opts).

@stale
Copy link

stale bot commented Mar 11, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Mar 11, 2018
@stale stale bot closed this as completed Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Relates to Salt documentation stale
Projects
None yet
Development

No branches or pull requests

3 participants