Skip to content

Document the Saltfile and clarify the --saltfile option (fixes #60210)#69238

Open
ggiesen wants to merge 1 commit into
saltstack:masterfrom
ggiesen:docs-60210-document-saltfile
Open

Document the Saltfile and clarify the --saltfile option (fixes #60210)#69238
ggiesen wants to merge 1 commit into
saltstack:masterfrom
ggiesen:docs-60210-document-saltfile

Conversation

@ggiesen
Copy link
Copy Markdown
Contributor

@ggiesen ggiesen commented May 27, 2026

What does this PR do?

Rewrites the "Define CLI Options with Saltfile" documentation and expands the --saltfile help string so it is clear what a Saltfile is and how it works.

The existing docs were framed as a salt-ssh-only feature and never explained what a Saltfile actually is, so users assumed it was a configuration file. The rewrite (same section, anchor preserved):

  • Explains a Saltfile is a YAML file that supplies command-line options (not configuration-file settings) for any Salt CLI tool (salt, salt-ssh, salt-call, salt-cloud, salt-key, ...).
  • Documents the search order: --saltfile, then SALT_SALTFILE, then ./Saltfile, then ~/.salt/Saltfile.
  • Keeps the existing note that keys are option destinations (dashes -> underscores), with the ssh_wipe example.
  • Adds an external-auth example using the CLI option destinations (eauth, username, password) rather than master-config keys such as external_auth, which is a common point of confusion.
  • Notes that Saltfile values currently take precedence over the same options passed on the command line.

Also expands the --saltfile help string in salt/utils/parsers.py to say it is a YAML file of command-line options (not a config file) and to list the full search order.

What issues does this PR fix or reference?

Fixes #60210

Previous Behavior

Documentation only described Saltfile in a salt-ssh context, did not explain its purpose, omitted the SALT_SALTFILE env var and the full search order, and did not clarify that it supplies CLI options rather than configuration settings.

New Behavior

Documentation-only change; no runtime behavior changes.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

  • Docs
  • Changelog - not applicable (documentation-only change; towncrier has no docs category)
  • Tests written/updated - not applicable (documentation-only)

Commits signed with GPG?

No

The Saltfile docs only covered salt-ssh and never explained what a Saltfile
actually is, which leads users to assume it is a configuration file rather
than a way to supply command-line options (saltstack#60210).

Rewrite the section to explain that a Saltfile supplies command-line options
(not config-file settings) for any Salt CLI tool, document the search order
(--saltfile, SALT_SALTFILE, ./Saltfile, ~/.salt/Saltfile), keep the
option-dest naming note, add an external-auth example using the CLI option
names rather than master-config keys, and note that Saltfile values currently
take precedence over options passed on the command line. Expand the
--saltfile help string to match.
@ggiesen
Copy link
Copy Markdown
Contributor Author

ggiesen commented May 27, 2026

Base rationale: targeting master, as this is a documentation change (clarifying what a Saltfile is and how --saltfile works), which per Salt's contributing guide goes to master unless it's tied to a bug fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Document --saltfile command-line option

1 participant