LinuxCommandLibrary

salt-run

Run Salt modules from the Salt master

TLDR

Show status of all minions

$ salt-run manage.status
copy

Show all minions which are disconnected
$ salt-run manage.up
copy

SYNOPSIS

salt-run . [options]

PARAMETERS

.
    Specifies the runner module and function to execute. For example, manage.down would execute the down function in the manage runner module.

-h, --help
    Show program's help message and exit.

-c CONFIG_DIR, --config-dir=CONFIG_DIR
    The location of the Salt configuration directory. Defaults to /etc/salt.

--out=outputter
    Specify an outputter to use.

--out-file=output_file
    Specify a file to output to.

--return
    Prints the return data.

--versions-report
    Show program's dependencies version number and exit.

DESCRIPTION

The salt-run command is the interface to Salt's execution runners. Runners are Python modules that execute on the Salt master and provide a way to perform tasks outside the normal Salt minion execution model. Runners can be used for a variety of purposes, including:
Querying the Salt data store
Performing administrative tasks on the Salt master
Interacting with external systems
Generating reports. salt-run allows you to execute these runner modules from the command line, specifying the runner module and any necessary arguments. It provides a powerful way to extend Salt's functionality and automate tasks related to Salt master management.

CAVEATS

The salt-run command must be executed on the Salt master server or from a system that has access to the Salt master's configuration and credentials. Some runners may require specific permissions or configurations to function correctly.

EXAMPLES

To execute the manage.down runner module function:
salt-run manage.down
To execute the state.orch with an orchestration state:
salt-run state.orch my_orchestration

SEE ALSO

salt(1), salt-call(1), salt-key(1)

Copied to clipboard