salt.resources.ssh.modules.state#
State module for the ssh resource type.
Implements state.highstate, state.sls, and state.apply for SSH
resources by replicating the salt-ssh state-execution pipeline on the
managing minion:
Compile —
SSHHighStatereads state and pillar files from the master via the minion'sRemoteClient. The resource ID is used as the top-file target, so only states mapped to that ID are compiled.Package —
prep_trans_tarbundles the compiled low state, all referencedsalt://files, and the rendered pillar into a transport tar (salt_state.tgz).Execute — The tar is SCP'd to the remote host's
thin_dirandstate.pkgis invoked via the salt-thin bundle, returning structured JSON results.
This mirrors what salt-ssh state.highstate does when invoked from the
master, but runs from the managing minion's process so the salt-ssh
initiator is the minion, not the master.
- salt.resources.ssh.modules.state.apply_(mods=None, **kwargs)#
Apply states to the SSH resource —
state.highstateif no mods are given,state.slsotherwise.CLI Example:
salt -C 'T@ssh:node1' state.apply salt -C 'T@ssh:node1' state.apply node1
- salt.resources.ssh.modules.state.highstate(test=None, **kwargs)#
Apply the highstate to the targeted SSH resource.
Compiles the highstate on the managing minion using the resource ID as the top-file target, packages all state files into a transport tar, SCPs the tar to the remote host, and runs
state.pkgvia the salt-thin bundle.CLI Example:
salt -C 'T@ssh:node1' state.highstate salt -C 'T@ssh:node1' state.highstate test=True
- salt.resources.ssh.modules.state.sls(mods, saltenv='base', test=None, **kwargs)#
Apply one or more state SLS files to the targeted SSH resource.
CLI Example:
salt -C 'T@ssh:node1' state.sls node1 salt -C 'T@ssh:node1' state.sls node1,common test=True