sys.doc: Return the docstrings for all execution modules and functions
sys.list_modules: List the execution modules loaded on the minion
pkg.version: Returns a string representing the package version or an empty string if not installed.
- salt * sys.doc test.ping
- salt-call sys.doc test
- salt-call sys.doc # To see documentation for all modules
sys.state_doc: Get help for state modules and functions. Return the docstrings for all states.
- salt-call sys.state_doc user.present
- salt-call sys.list_modules
- salt-call sys.list_functions sys
- salt-call sys.list_state_modules
sys.list_state_functions: List the functions for all state modules.
- salt-call sys.list_state_functions user
cmd.run: Execute the passed command and return the output as a string
- salt * cmd.run 'uptime'
- salt * cmd.run 'date'
- salt * cmd.run 'grep root /etc/passwd'
- salt-call cmd.run cwd=/usr 'pwd'
- salt * cmd.run whoami runas=vagrant #by default commands are run with root.
- salt-call cmd.run env='{foo: bar}' 'echo $foo' #set environment variable
- salt * pkg.list_pkgs
pkg.available_version: See What Version Will Be Installed
- salt * pkg.available_version nginx
pkg.install: Install the passed package(s)
- salt centos65-minion pkg.install nginx
- salt centos65-minion pkg.version nginx
user.add: Add a user to the minion
- salt centos65-minion user.add wilma
- salt centos65-minion cmd.run 'grep wilma /etc/passwd' #verify
user.list_users: Return a list of all users
- salt centos65-minion user.list_users
user.info: Return user information
- salt centos65-minion user.info wilma
saltutil: The Saltutil module is used to manage the state of the salt minion itself. It is used to manage minion modules as well as automate updates to the salt minion.
saltutil.sync_modules: Sync the modules from the _modules directory on the salt master file server.
- salt vagrant-centos65.vagrantup.com saltutil.sync_modules
saltutil.sync_all: Sync down all of the dynamic modules from the file server for a specific environment. This function synchronizes custom modules, states, beacons, grains, returners, output modules, renderers, and utils.
- salt vagrant-centos65.vagrantup.com saltutil.sync_all
saltutil.running: Return the data on all running salt processes on the minion
- salt vagrant-centos65.vagrantup.com cmd.run 'sleep 100'
- salt vagrant-centos65.vagrantup.com saltutil.running
saltutil.kill_job: Sends a kill signal (SIGKILL 9) to the named salt job's process
- salt vagrant-centos65.vagrantup.com saltutil.kill_job 20151231192241285570
- salt vagrant-centos65.vagrantup.com cp.list_states
- salt ubuntu-14.04-amd64-vbox state.show_highstate
No comments:
Post a Comment