salt的模块使用示例,方便查看。

#salt "*" sys.doc

acl.delfacl:

    Remove specific FACL from the specified file(s)

    CLI Examples:

        salt '*' acl.delfacl user myuser /tmp/house/kitchen
        salt '*' acl.delfacl default:group mygroup /tmp/house/kitchen
        salt '*' acl.delfacl d:u myuser /tmp/house/kitchen
        salt '*' acl.delfacl g myuser /tmp/house/kitchen /tmp/house/livingroom
    

acl.getfacl:

    Return (extremely verbose) map of FACLs on specified file(s)

    CLI Examples:

        salt '*' acl.getfacl /tmp/house/kitchen
        salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom
    

acl.modfacl:

    Add or modify a FACL for the specified file(s)

    CLI Examples:

        salt '*' acl.addfacl user myuser rwx /tmp/house/kitchen
        salt '*' acl.addfacl default:group mygroup rx /tmp/house/kitchen
        salt '*' acl.addfacl d:u myuser 7 /tmp/house/kitchen
        salt '*' acl.addfacl g mygroup 0 /tmp/house/kitchen /tmp/house/livingroom
    

acl.version:

    Return facl version from getfacl --version

    CLI Example:

        salt '*' acl.version
    

acl.wipefacls:

    Remove all FACLs from the specified file(s)

    CLI Examples:

        salt '*' acl.wipefacls /tmp/house/kitchen
        salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/livingroom
    

aliases.get_target:

    Return the target associated with an alias

    CLI Example:

        salt '*' aliases.get_target alias
    

aliases.has_target:

    Return true if the alias/target is set

    CLI Example:

        salt '*' aliases.has_target alias target
    

aliases.list_aliases:

    Return the aliases found in the aliases file in this format::

        {'alias': 'target'}

    CLI Example:

        salt '*' aliases.list_aliases
    

aliases.rm_alias:

    Remove an entry from the aliases file

    CLI Example:

        salt '*' aliases.rm_alias alias
    

aliases.set_target:

    Set the entry in the aliases file for the given alias, this will overwrite
    any previous entry for the given alias or create a new one if it does not
    exist.

    CLI Example:

        salt '*' aliases.set_target alias target
    

alternatives.auto:

    Trigger alternatives to set the path for <name> as
    specified by priority.

    CLI Example:

        salt '*' alternatives.auto name
    

alternatives.check_installed:

    Check if the current highest-priority match for a given alternatives link
    is set to the desired path

    CLI Example:

        salt '*' alternatives.check_installed name path
    

alternatives.display:

    Display alternatives settings for defined command name

    CLI Example:

        salt '*' alternatives.display editor
    

alternatives.install:

    Install symbolic links determining default commands

    CLI Example:

        salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50
    

alternatives.remove:

    Remove symbolic links determining the default commands.

    CLI Example:

        salt '*' alternatives.remove name path
    

alternatives.set:

    Manually set the alternative <path> for <name>.

    CLI Example:

        salt '*' alternatives.set name path
    

alternatives.show_current:

    Display the current highest-priority alternative for a given alternatives
    link

    CLI Example:

        salt '*' alternatives.show_current editor
    

apache.a2dissite:

    Runs a2dissite for the given site.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

        salt '*' apache.a2dissite example.com
    

apache.a2ensite:

    Runs a2ensite for the given site.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

        salt '*' apache.a2ensite example.com
    

apache.check_site_enabled:

    Checks to see if the specific Site symlink is in /etc/apache2/sites-enabled.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

        salt '*' apache.check_site_enabled example.com
    

apache.directives:

    Return list of directives together with expected arguments
    and places where the directive is valid (``apachectl -L``)

    CLI Example:

        salt '*' apache.directives
    

apache.fullversion:

    Return server version from apachectl -V

    CLI Example:

        salt '*' apache.fullversion
    

apache.modules:

    Return list of static and shared modules from apachectl -M

    CLI Example:

        salt '*' apache.modules
    

apache.server_status:

    Get Information from the Apache server-status handler

    NOTE:
    the server-status handler is disabled by default.
    in order for this function to work it needs to be enabled.
    http://httpd.apache.org/docs/2.2/mod/mod_status.html

    The following configuration needs to exists in pillar/grains
    each entry nested in apache.server-status is a profile of a vhost/server
    this would give support for multiple apache servers/vhosts

    apache.server-status:
      'default':
        'url': http://localhost/server-status
        'user': someuser
        'pass': password
        'realm': 'authentication realm for digest passwords'
        'timeout': 5

    CLI Examples:

        salt '*' apache.server_status
        salt '*' apache.server_status other-profile
    

apache.servermods:

    Return list of modules compiled into the server (apachectl -l)

    CLI Example:

        salt '*' apache.servermods
    

apache.signal:

    Signals httpd to start, restart, or stop.

    CLI Example:

        salt '*' apache.signal restart
    

apache.useradd:

    Add an HTTP user using the htpasswd command. If the htpasswd file does not
    exist, it will be created. Valid options that can be passed are:

        n  Don't update file; display results on stdout.
        m  Force MD5 encryption of the password (default).
        d  Force CRYPT encryption of the password.
        p  Do not encrypt the password (plaintext).
        s  Force SHA encryption of the password.

    CLI Examples:

        salt '*' apache.useradd /etc/httpd/htpasswd larry badpassword
        salt '*' apache.useradd /etc/httpd/htpasswd larry badpass opts=ns
    

apache.userdel:

    Delete an HTTP user from the specified htpasswd file.

    CLI Examples:

        salt '*' apache.userdel /etc/httpd/htpasswd larry
    

apache.version:

    Return server version from apachectl -v

    CLI Example:

        salt '*' apache.version
    

apache.vhosts:

    Show the settings as parsed from the config file (currently
    only shows the virtualhost settings). (``apachectl -S``)
    Because each additional virtual host adds to the execution
    time, this command may require a long timeout be specified.

    CLI Example:

        salt -t 10 '*' apache.vhosts
    

archive.gunzip:

    Uses the gunzip command to unpack gzip files

    CLI Example to create ``/tmp/sourcefile.txt``:

        salt '*' archive.gunzip /tmp/sourcefile.txt.gz

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.

    CLI Example:

        salt '*' archive.gunzip template=jinja /tmp/{{grains.id}}.txt.gz

    

archive.gzip:

    Uses the gzip command to create gzip files

    CLI Example to create ``/tmp/sourcefile.txt.gz``:

        salt '*' archive.gzip /tmp/sourcefile.txt

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.

    CLI Example:

        salt '*' archive.gzip template=jinja /tmp/{{grains.id}}.txt

    

archive.rar:

    Uses the rar command to create rar files
    Uses rar for Linux from http://www.rarlab.com/

    CLI Example:

        salt '*' archive.rar /tmp/rarfile.rar /tmp/sourcefile1,/tmp/sourcefile2

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.

    For example:

        salt '*' archive.rar template=jinja /tmp/rarfile.rar /tmp/sourcefile1,/tmp/{{grains.id}}.txt


    

archive.tar:

    Note:

        This function has changed for version 0.17.0. In prior versions, the
        ``cwd`` and ``template`` arguments must be specified, with the source
        directories/files coming as a space-separated list at the end of the
        command. Beginning with 0.17.0, ``sources`` must be a comma-separated
        list, and the ``cwd`` and ``template`` arguments are optional.

    Uses the tar command to pack, unpack, etc tar files


    options:
        Options to pass to the ``tar`` binary.

    tarfile:
        The tar filename to pack/unpack.

    sources:
        Comma delimited list of files to **pack** into the tarfile.

    dest:
        The destination directory to **unpack** the tarfile to.

    cwd:
        The directory in which the tar command should be executed.

    template:
         Template engine name to render the command arguments before execution.

    CLI Example:

        salt '*' archive.tar cjvf /tmp/tarfile.tar.bz2 /tmp/file_1,/tmp/file_2


    The template arg can be set to ``jinja`` or another supported template
    engine to render the command arguments before execution. For example:

        salt '*' archive.tar template=jinja cjvf /tmp/salt.tar.bz2 {{grains.saltpath}}


    To unpack a tarfile, for example:

        salt '*' archive.tar foo.tar xf dest=/target/directory

    

archive.unrar:

    Uses the unrar command to unpack rar files
    Uses rar for Linux from http://www.rarlab.com/

    CLI Example:

        salt '*' archive.unrar /tmp/rarfile.rar /home/strongbad/ excludes=file_1,file_2

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.

    For example:

        salt '*' archive.unrar template=jinja /tmp/rarfile.rar /tmp/{{grains.id}}/ excludes=file_1,file_2

    

archive.unzip:

    Uses the unzip command to unpack zip files

    options:
        Options to pass to the ``unzip`` binary.

    CLI Example:

        salt '*' archive.unzip /tmp/zipfile.zip /home/strongbad/ excludes=file_1,file_2

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.

    For example:

        salt '*' archive.unzip template=jinja /tmp/zipfile.zip /tmp/{{grains.id}}/ excludes=file_1,file_2

    

archive.zip:

    Uses the zip command to create zip files

    CLI Example:

        salt '*' archive.zip /tmp/zipfile.zip /tmp/sourcefile1,/tmp/sourcefile2

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.

    For example:

        salt '*' archive.zip template=jinja /tmp/zipfile.zip /tmp/sourcefile1,/tmp/{{grains.id}}.txt

    

at.at:

    Add a job to the queue.

    The 'timespec' follows the format documented in the
    at(1) manpage.

    CLI Example:

        salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>]
        salt '*' at.at 12:05am '/sbin/reboot' tag=reboot
        salt '*' at.at '3:05am +3 days' 'bin/myscript' tag=nightly runas=jim
    

at.atc:

    Print the at(1) script that will run for the passed job
    id. This is mostly for debugging so the output will
    just be text.

    CLI Example:

        salt '*' at.atc <jobid>
    

at.atq:

    List all queued and running jobs or only those with
    an optional 'tag'.

    CLI Example:

        salt '*' at.atq
        salt '*' at.atq [tag]
        salt '*' at.atq [job number]
    

at.atrm:

    Remove jobs from the queue.

    CLI Example:

        salt '*' at.atrm <jobid> <jobid> .. <jobid>
        salt '*' at.atrm all
        salt '*' at.atrm all [tag]
    

at.jobcheck:

    Check the job from queue.
    The kwargs dict include 'hour minute day month year tag runas'
    Other parameters will be ignored.

    CLI Example:

        salt '*' at.jobcheck runas=jam day=13
        salt '*' at.jobcheck day=13 month=12 year=13 tag=rose
    

buildout.bootstrap:

    Run the buildout bootstrap dance (python bootstrap.py).

    directory
        directory to execute in

    config
        alternative buildout configuration file to use

    runas
        User used to run buildout as

    env
        environment variables to set when running

    buildout_ver
        force a specific buildout version (1 | 2)

    test_release
        buildout accept test release

    offline
        are we executing buildout in offline mode

    distribute
        Forcing use of distribute

    new_set
        Forcing use of setuptools >= 0.7

    python
        path to a python executable to use in place of default (salt one)

    onlyif
        Only execute cmd if statement on the host return 0

    unless
        Do not execute cmd if statement on the host return 0

    CLI Example:

        salt '*' buildout.bootstrap /srv/mybuildout
    

buildout.buildout:

    Run buildout in a directory.

    directory
        directory to execute in

    config
        buildout config to use

    parts
        specific buildout parts to run

    runas
        user used to run buildout as

    env
        environment variables to set when running

    buildout_ver
        force a specific buildout version (1 | 2)

    test_release
        buildout accept test release

    new_set
        Forcing use of setuptools >= 0.7

    distribute
        use distribute over setuptools if possible

    offline
        does buildout run offline

    python
        python to use

    debug
        run buildout with -D debug flag

    onlyif
        Only execute cmd if statement on the host return 0

    unless
        Do not execute cmd if statement on the host return 0
    newest
        run buildout in newest mode

    verbose
        run buildout in verbose mode (-vvvvv)


    CLI Example:

        salt '*' buildout.buildout /srv/mybuildout
    

buildout.run_buildout:

    Run a buildout in a directory.

    directory
        directory to execute in

    config
        alternative buildout configuration file to use

    offline
        are we executing buildout in offline mode

    runas
        user used to run buildout as

    env
        environment variables to set when running

    onlyif
        Only execute cmd if statement on the host return 0

    unless
        Do not execute cmd if statement on the host return 0

    newest
        run buildout in newest mode

    force
        run buildout unconditionally

    verbose
        run buildout in verbose mode (-vvvvv)

    CLI Example:

        salt '*' buildout.run_buildout /srv/mybuildout
    

buildout.upgrade_bootstrap:

    Upgrade current bootstrap.py with the last released one.

    Indeed, when we first run a buildout, a common source of problem
    is to have a locally stale bootstrap, we just try to grab a new copy

    directory
        directory to execute in

    offline
        are we executing buildout in offline mode

    buildout_ver
        forcing to use a specific buildout version (1 | 2)

    onlyif
        Only execute cmd if statement on the host return 0

    unless
        Do not execute cmd if statement on the host return 0

    CLI Example:

        salt '*' buildout.upgrade_bootstrap /srv/mybuildout
    

cloud.action:

    Execute a single action on the given provider/instance

    CLI Example:

        salt '*' cloud.action start instance=myinstance
        salt '*' cloud.action stop instance=myinstance
        salt '*' cloud.action show_image provider=my-ec2-config             image=ami-1624987f
    

cloud.create:

    Create an instance using Salt Cloud

    CLI Example:

        salt minionname cloud.create my-ec2-config myinstance             image=ami-1624987f size='Micro Instance' ssh_username=ec2-user             securitygroup=default delvol_on_destroy=True
    

cloud.destroy:

    Destroy the named VM(s)

    CLI Example:

        salt '*' cloud.destroy myinstance
    

cloud.full_query:

    List all available cloud provider data

    CLI Example:

        salt '*' cloud.full_query
    

cloud.list_images:

    List cloud provider images for the given providers

    CLI Example:

        salt '*' cloud.list_images my-gce-config
    

cloud.list_locations:

    List cloud provider locations for the given providers

    CLI Example:

        salt '*' cloud.list_locations my-gce-config
    

cloud.list_sizes:

    List cloud provider sizes for the given providers

    CLI Example:

        salt '*' cloud.list_sizes my-gce-config
    

cloud.profile:

    Spin up an instance using Salt Cloud

    CLI Example:

        salt '*' cloud.profile my-gce-config myinstance
    

cloud.query:

    List cloud provider data for all providers

    CLI Examples:

        salt '*' cloud.query
        salt '*' cloud.query list_nodes_full
        salt '*' cloud.query list_nodes_select
    

cloud.select_query:

    List selected nodes

    CLI Example:

        salt '*' cloud.select_query
    

cmd.exec_code:

    Pass in two strings, the first naming the executable language, aka -
    python2, python3, ruby, perl, lua, etc. the second string containing
    the code you wish to execute. The stdout and stderr will be returned

    CLI Example:

        salt '*' cmd.exec_code ruby 'puts "cheese"'
    

cmd.has_exec:

    Returns true if the executable is available on the minion, false otherwise

    CLI Example:

        salt '*' cmd.has_exec cat
    

cmd.retcode:

    Execute a shell command and return the command's return code.

    Note that ``env`` represents the environment variables for the command, and
    should be formatted as a dict, or a YAML string which resolves to a dict.

    CLI Example:

        salt '*' cmd.retcode "file /bin/bash"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

        salt '*' cmd.retcode template=jinja "file {{grains.pythonpath[0]}}/python"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.:

        salt '*' cmd.retcode "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    

cmd.run:

    Execute the passed command and return the output as a string

    Note that ``env`` represents the environment variables for the command, and
    should be formatted as a dict, or a YAML string which resolves to a dict.

    CLI Example:

        salt '*' cmd.run "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

        salt '*' cmd.run template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    Specify an alternate shell with the shell parameter:

        salt '*' cmd.run "Get-ChildItem C:\ " shell='powershell'

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.:

        salt '*' cmd.run "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    

cmd.run_all:

    Execute the passed command and return a dict of return data

    Note that ``env`` represents the environment variables for the command, and
    should be formatted as a dict, or a YAML string which resolves to a dict.

    CLI Example:

        salt '*' cmd.run_all "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

        salt '*' cmd.run_all template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.:

        salt '*' cmd.run_all "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    

cmd.run_stderr:

    Execute a command and only return the standard error

    Note that ``env`` represents the environment variables for the command, and
    should be formatted as a dict, or a YAML string which resolves to a dict.

    CLI Example:

        salt '*' cmd.run_stderr "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

        salt '*' cmd.run_stderr template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.:

        salt '*' cmd.run_stderr "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    

cmd.run_stdout:

    Execute a command, and only return the standard out

    Note that ``env`` represents the environment variables for the command, and
    should be formatted as a dict, or a YAML string which resolves to a dict.

    CLI Example:

        salt '*' cmd.run_stdout "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

        salt '*' cmd.run_stdout template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.:

        salt '*' cmd.run_stdout "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    

cmd.script:

    Download a script from a remote location and execute the script locally.
    The script can be located on the salt master file server or on an HTTP/FTP
    server.

    The script will be executed directly, so it can be written in any available
    programming language.

    The script can also be formated as a template, the default is jinja.
    Arguments for the script can be specified as well.

    CLI Example:

        salt '*' cmd.script salt://scripts/runme.sh
        salt '*' cmd.script salt://scripts/runme.sh 'arg1 arg2 "arg 3"'
        salt '*' cmd.script salt://scripts/windows_task.ps1 args=' -Input c:\tmp\infile.txt' shell='powershell'

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.:

        salt '*' cmd.script salt://scripts/runme.sh stdin='one\ntwo\nthree\nfour\nfive\n'
    

cmd.script_retcode:

    Download a script from a remote location and execute the script locally.
    The script can be located on the salt master file server or on an HTTP/FTP
    server.

    The script will be executed directly, so it can be written in any available
    programming language.

    The script can also be formated as a template, the default is jinja.

    Only evaluate the script return code and do not block for terminal output

    CLI Example:

        salt '*' cmd.script_retcode salt://scripts/runme.sh

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.:

        salt '*' cmd.script_retcode salt://scripts/runme.sh stdin='one\ntwo\nthree\nfour\nfive\n'
    

cmd.which:

    Returns the path of an executable available on the minion, None otherwise

    CLI Example:

        salt '*' cmd.which cat
    

cmd.which_bin:

    Returns the first command found in a list of commands

    CLI Example:

        salt '*' cmd.which_bin '[pip2, pip, pip-python]'
    

composer.install:

    Install composer dependencies for a directory.

    If composer has not been installed globally making it avaliable in the
    system PATH & making it executible, the ``composer`` and ``php`` parameters
    will need to be set to the location of the executables.

    dir
        Directory location of the composer.json file.

    composer
        Location of the composer.phar file. If not set composer will
        just execute "composer" as if it is installed globally.
        (i.e. /path/to/composer.phar)

    php
        Location of the php executible to use with composer.
        (i.e. /usr/bin/php)

    runas
        Which system user to run composer as.

    prefer_source
        --prefer-source option of composer.

    prefer_dist
        --prefer-dist option of composer.

    no_scripts
        --no-scripts option of composer.

    no_plugins
        --no-plugins option of composer.

    optimize
        --optimize-autoloader option of composer. Recommended for production.

    no_dev
        --no-dev option for composer. Recommended for production.

    quiet
        --quiet option for composer. Whether or not to return output from composer.

    composer_home
        $COMPOSER_HOME environment variable

    CLI Example:

        salt '*' composer.install /var/www/application

        salt '*' composer.install /var/www/application             no_dev=True optimize=True
    

config.backup_mode:

    Return the backup mode

    CLI Example:

        salt '*' config.backup_mode
    

config.dot_vals:

    Pass in a configuration value that should be preceded by the module name
    and a dot, this will return a list of all read key/value pairs

    CLI Example:

        salt '*' config.dot_vals host
    

config.gather_bootstrap_script:

    Download the salt-bootstrap script, set replace to True to refresh the
    script if it has already been downloaded

    CLI Example:

        salt '*' config.gather_bootstrap_script True
    

config.get:

    .. versionadded: 0.14.0

    Attempt to retrieve the named value from opts, pillar, grains of the master
    config, if the named value is not available return the passed default.
    The default return is an empty string.

    The value can also represent a value in a nested dict using a ":" delimiter
    for the dict. This means that if a dict looks like this::

        {'pkg': {'apache': 'httpd'}}

    To retrieve the value associated with the apache key in the pkg dict this
    key can be passed::

        pkg:apache

    This routine traverses these data stores in this order:

    - Local minion config (opts)
    - Minion's grains
    - Minion's pillar
    - Master config

    CLI Example:

        salt '*' config.get pkg:apache
    

config.manage_mode:

    Return a mode value, normalized to a string

    CLI Example:

        salt '*' config.manage_mode
    

config.merge:

    Retrieves an option based on key, merging all matches.

    Same as ``option()`` except that it merges all matches, rather than taking
    the first match.

    CLI Example:

        salt '*' config.merge schedule
    

config.option:

    Pass in a generic option and receive the value that will be assigned

    CLI Example:

        salt '*' config.option redis.host
    

config.valid_fileproto:

    Returns a boolean value based on whether or not the URI passed has a valid
    remote file protocol designation

    CLI Example:

        salt '*' config.valid_fileproto salt://path/to/file
    

cp.cache_dir:

    Download and cache everything under a directory from the master

    CLI Example:

        salt '*' cp.cache_dir salt://path/to/dir
    

cp.cache_file:

    Used to cache a single file in the local salt-master file cache.

    CLI Example:

        salt '*' cp.cache_file salt://path/to/file
    

cp.cache_files:

    Used to gather many files from the master, the gathered files will be
    saved in the minion cachedir reflective to the paths retrieved from the
    master.

    CLI Example:

        salt '*' cp.cache_files salt://pathto/file1,salt://pathto/file1
    

cp.cache_local_file:

    Cache a local file on the minion in the localfiles cache

    CLI Example:

        salt '*' cp.cache_local_file /etc/hosts
    

cp.cache_master:

    Retrieve all of the files on the master and cache them locally

    CLI Example:

        salt '*' cp.cache_master
    

cp.get_dir:

    Used to recursively copy a directory from the salt master

    CLI Example:

        salt '*' cp.get_dir salt://path/to/dir/ /minion/dest

    get_dir supports the same template and gzip arguments as get_file.
    

cp.get_file:

    Used to get a single file from the salt master

    CLI Example:

        salt '*' cp.get_file salt://path/to/file /minion/dest

    Template rendering can be enabled on both the source and destination file
    names like so:

        salt '*' cp.get_file "salt://{{grains.os}}/vimrc" /etc/vimrc template=jinja

    This example would instruct all Salt minions to download the vimrc from a
    directory with the same name as their os grain and copy it to /etc/vimrc

    For larger files, the cp.get_file module also supports gzip compression.
    Because gzip is CPU-intensive, this should only be used in scenarios where
    the compression ratio is very high (e.g. pretty-printed JSON or YAML
    files).

    Use the *gzip* named argument to enable it.  Valid values are 1..9, where 1
    is the lightest compression and 9 the heaviest.  1 uses the least CPU on
    the master (and minion), 9 uses the most.
    

cp.get_file_str:

    Return the contents of a file from a URL

    CLI Example:

        salt '*' cp.get_file_str salt://my/file
    

cp.get_template:

    Render a file as a template before setting it down

    CLI Example:

        salt '*' cp.get_template salt://path/to/template /minion/dest
    

cp.get_url:

    Used to get a single file from a URL.

    CLI Example:

        salt '*' cp.get_url salt://my/file /tmp/mine
        salt '*' cp.get_url http://www.slashdot.org /tmp/index.html
    

cp.hash_file:

    Return the hash of a file, to get the hash of a file on the
    salt master file server prepend the path with salt://<file on server>
    otherwise, prepend the file with / for a local file.

    CLI Example:

        salt '*' cp.hash_file salt://path/to/file
    

cp.is_cached:

    Return a boolean if the given path on the master has been cached on the
    minion

    CLI Example:

        salt '*' cp.is_cached salt://path/to/file
    

cp.list_master:

    List all of the files stored on the master

    CLI Example:

        salt '*' cp.list_master
    

cp.list_master_dirs:

    List all of the directories stored on the master

    CLI Example:

        salt '*' cp.list_master_dirs
    

cp.list_master_symlinks:

    List all of the symlinks stored on the master

    CLI Example:

        salt '*' cp.list_master_symlinks
    

cp.list_minion:

    List all of the files cached on the minion

    CLI Example:

        salt '*' cp.list_minion
    

cp.list_states:

    List all of the available state modules in an environment

    CLI Example:

        salt '*' cp.list_states
    

cp.push:

    Push a file from the minion up to the master, the file will be saved to
    the salt master in the master's minion files cachedir
    (defaults to ``/var/cache/salt/master/minions/minion-id/files``)

    Since this feature allows a minion to push a file up to the master server
    it is disabled by default for security purposes. To enable, set
    ``file_recv`` to ``True`` in the master configuration file, and restart the
    master.

    CLI Example:

        salt '*' cp.push /etc/fstab
    

cp.recv:

    Used with salt-cp, pass the files dict, and the destination.

    This function receives small fast copy files from the master via salt-cp.
    It does not work via the CLI.
    

cron.list_tab:

    Return the contents of the specified user's crontab

    CLI Example:

        salt '*' cron.list_tab root
    

cron.ls:

    Return the contents of the specified user's crontab

    CLI Example:

        salt '*' cron.list_tab root
    

cron.raw_cron:

    Return the contents of the user's crontab

    CLI Example:

        salt '*' cron.raw_cron root
    

cron.rm:

    Remove a cron job for a specified user. If any of the day/time params are
    specified, the job will only be removed if the specified params match.

    CLI Example:

        salt '*' cron.rm_job root /usr/local/weekly
        salt '*' cron.rm_job root /usr/bin/foo dayweek=1
    

cron.rm_env:

    Remove cron environment variable for a specified user.

    CLI Example:

        salt '*' cron.rm_env root MAILTO
    

cron.rm_job:

    Remove a cron job for a specified user. If any of the day/time params are
    specified, the job will only be removed if the specified params match.

    CLI Example:

        salt '*' cron.rm_job root /usr/local/weekly
        salt '*' cron.rm_job root /usr/bin/foo dayweek=1
    

cron.set_env:

    Set up an environment variable in the crontab.

    CLI Example:

        salt '*' cron.set_env root MAILTO user@example.com
    

cron.set_job:

    Sets a cron job up for a specified user.

    CLI Example:

        salt '*' cron.set_job root '*' '*' '*' '*' 1 /usr/local/weekly
    

cron.set_special:

    Set up a special command in the crontab.

    CLI Example:

        salt '*' cron.set_special root @hourly 'echo foobar'
    

cron.write_cron_file:

    Writes the contents of a file to a user's crontab

    CLI Example:

        salt '*' cron.write_cron_file root /tmp/new_cron
    

cron.write_cron_file_verbose:

    Writes the contents of a file to a user's crontab and return error message on error

    CLI Example:

        salt '*' cron.write_cron_file_verbose root /tmp/new_cron
    

daemontools.available:

    Returns ``True`` if the specified service is available, otherwise returns
    ``False``.

    CLI Example:

        salt '*' daemontools.available foo
    

daemontools.full_restart:

    Calls daemontools.restart() function

    CLI Example:

        salt '*' daemontools.full_restart <service name>
    

daemontools.get_all:

    Return a list of all available services

    CLI Example:

        salt '*' daemontools.get_all
    

daemontools.missing:

    The inverse of daemontools.available.
    Returns ``True`` if the specified service is not available, otherwise returns
    ``False``.

    CLI Example:

        salt '*' daemontools.missing foo
    

daemontools.reload:

    Wrapper for term()

    CLI Example:

        salt '*' daemontools.reload <service name>
    

daemontools.restart:

    Restart service via daemontools. This will stop/start service

    CLI Example:

        salt '*' daemontools.restart <service name>
    

daemontools.start:

    Starts service via daemontools

    CLI Example:

        salt '*' daemontools.start <service name>
    

daemontools.status:

    Return the status for a service via daemontools, return pid if running

    CLI Example:

        salt '*' daemontools.status <service name>
    

daemontools.stop:

    Stops service via daemontools

    CLI Example:

        salt '*' daemontools.stop <service name>
    

daemontools.term:

    Send a TERM to service via daemontools

    CLI Example:

        salt '*' daemontools.term <service name>
    

data.cas:

    Check and set a value in the minion datastore

    CLI Example:

        salt '*' data.cas <key> <value> <old_value>
    

data.clear:

    Clear out all of the data in the minion datastore, this function is
    destructive!

    CLI Example:

        salt '*' data.clear
    

data.dump:

    Replace the entire datastore with a passed data structure

    CLI Example:

        salt '*' data.dump '{'eggs': 'spam'}'
    

data.getval:

    Get a value from the minion datastore

    CLI Example:

        salt '*' data.getval <key>
    

data.getvals:

    Get values from the minion datastore

    CLI Example:

        salt '*' data.getvals <key> [<key> ...]
    

data.load:

    Return all of the data in the minion datastore

    CLI Example:

        salt '*' data.load
    

data.update:

    Update a key with a value in the minion datastore

    CLI Example:

        salt '*' data.update <key> <value>
    

defaults.get:

    defaults.get is used much like pillar.get except that it will read
    a default value for a pillar from defaults.json or defaults.yaml
    files that are stored in the root of a salt formula.

    When called from the CLI it works exactly like pillar.get.

    CLI Example:

        salt '*' defaults.get core:users:root

    When called from an SLS file, it works by first reading a defaults.json
    and second a defaults.yaml file. If the key exists in these files and
    does not exist in a pillar named after the formula, the value from the
    defaults file is used.

    Example core/defaults.json file for the 'core' formula:

        {
            "users": {
                "root": 0
            }
        }

    With this, from a state file you can use salt['defaults.get']('users:root')
    to read the '0' value from defaults.json if a core:users:root pillar
    key is not defined.
    

dig.A:

    Return the A record for ``host``.

    Always returns a list.

    CLI Example:

        salt ns1 dig.A www.google.com
    

dig.AAAA:

    Return the AAAA record for ``host``.

    Always returns a list.

    CLI Example:

        salt ns1 dig.AAAA www.google.com
    

dig.MX:

    Return a list of lists for the MX of ``domain``.

    If the ``resolve`` argument is True, resolve IPs for the servers.

    It's limited to one IP, because although in practice it's very rarely a
    round robin, it is an acceptable configuration and pulling just one IP lets
    the data be similar to the non-resolved version. If you think an MX has
    multiple IPs, don't use the resolver here, resolve them in a separate step.

    CLI Example:

        salt ns1 dig.MX google.com
    

dig.NS:

    Return a list of IPs of the nameservers for ``domain``

    If ``resolve`` is False, don't resolve names.

    CLI Example:

        salt ns1 dig.NS google.com
    

dig.SPF:

    Return the allowed IPv4 ranges in the SPF record for ``domain``.

    If record is ``SPF`` and the SPF record is empty, the TXT record will be
    searched automatically. If you know the domain uses TXT and not SPF,
    specifying that will save a lookup.

    CLI Example:

        salt ns1 dig.SPF google.com
    

dig.a:

    Return the A record for ``host``.

    Always returns a list.

    CLI Example:

        salt ns1 dig.A www.google.com
    

dig.aaaa:

    Return the AAAA record for ``host``.

    Always returns a list.

    CLI Example:

        salt ns1 dig.AAAA www.google.com
    

dig.check_ip:

    Check if address is a valid IP. returns True if valid, otherwise False.

    CLI Example:

        salt ns1 dig.check_ip 127.0.0.1
        salt ns1 dig.check_ip 1111:2222:3333:4444:5555:6666:7777:8888
    

dig.mx:

    Return a list of lists for the MX of ``domain``.

    If the ``resolve`` argument is True, resolve IPs for the servers.

    It's limited to one IP, because although in practice it's very rarely a
    round robin, it is an acceptable configuration and pulling just one IP lets
    the data be similar to the non-resolved version. If you think an MX has
    multiple IPs, don't use the resolver here, resolve them in a separate step.

    CLI Example:

        salt ns1 dig.MX google.com
    

dig.ns:

    Return a list of IPs of the nameservers for ``domain``

    If ``resolve`` is False, don't resolve names.

    CLI Example:

        salt ns1 dig.NS google.com
    

dig.spf:

    Return the allowed IPv4 ranges in the SPF record for ``domain``.

    If record is ``SPF`` and the SPF record is empty, the TXT record will be
    searched automatically. If you know the domain uses TXT and not SPF,
    specifying that will save a lookup.

    CLI Example:

        salt ns1 dig.SPF google.com
    

disk.inodeusage:

    Return inode usage information for volumes mounted on this minion

    CLI Example:

        salt '*' disk.inodeusage
    

disk.percent:

    Return partion information for volumes mounted on this minion

    CLI Example::

        salt '*' disk.percent /var
    

disk.usage:

    Return usage information for volumes mounted on this minion

    CLI Example:

        salt '*' disk.usage
    

django.collectstatic:

    Collect static files from each of your applications into a single location
    that can easily be served in production.

    CLI Example:

        salt '*' django.collectstatic <settings_module>
    

django.command:

    Run arbitrary django management command

    CLI Example:

        salt '*' django.command <settings_module> <command>
    

django.createsuperuser:

    Create a super user for the database.
    This function defaults to use the ``--noinput`` flag which prevents the
    creation of a password for the superuser.

    CLI Example:

        salt '*' django.createsuperuser <settings_module> user user@example.com
    

django.loaddata:

    Load fixture data

    Fixtures:
        comma separated list of fixtures to load

    CLI Example:

        salt '*' django.loaddata <settings_module> <comma delimited list of fixtures>

    

django.syncdb:

    Run syncdb

    Execute the Django-Admin syncdb command, if South is available on the
    minion the ``migrate`` option can be passed as ``True`` calling the
    migrations to run after the syncdb completes

    CLI Example:

        salt '*' django.syncdb <settings_module>
    

dnsmasq.fullversion:

    Shows installed version of dnsmasq, and compile options

    CLI Example:

        salt '*' dnsmasq.version
    

dnsmasq.get_config:

    Dumps all options from the config file

    CLI Examples:

        salt '*' dnsmasq.get_config
        salt '*' dnsmasq.get_config file=/etc/dnsmasq.conf
    

dnsmasq.set_config:

    Sets a value or a set of values in the specified file. By default, if
    conf-dir is configured in this file, salt will attempt to set the option
    in any file inside the conf-dir where it has already been enabled. If it
    does not find it inside any files, it will append it to the main config
    file. Setting follow to False will turn off this behavior.

    If a config option currently appears multiple times (such as dhcp-host,
    which is specified at least once per host), the new option will be added
    to the end of the main config file (and not to any includes). If you need
    an option added to a specific include file, specify it as the config_file.

    CLI Examples:

        salt '*' dnsmasq.set_config domain=mydomain.com
        salt '*' dnsmasq.set_config follow=False domain=mydomain.com
        salt '*' dnsmasq.set_config file=/etc/dnsmasq.conf domain=mydomain.com
    

dnsmasq.version:

    Shows installed version of dnsmasq

    CLI Example:

        salt '*' dnsmasq.version
    

dnsutil.A:

    Return the A record for 'host'.

    Always returns a list.

    CLI Example:

        salt ns1 dig.A www.google.com
    

dnsutil.MX:

    Return a list of lists for the MX of ``domain``.

    If the 'resolve' argument is True, resolve IPs for the servers.

    It's limited to one IP, because although in practice it's very rarely a
    round robin, it is an acceptable configuration and pulling just one IP lets
    the data be similar to the non-resolved version. If you think an MX has
    multiple IPs, don't use the resolver here, resolve them in a separate step.

    CLI Example:

        salt ns1 dig.MX google.com
    

dnsutil.NS:

    Return a list of IPs of the nameservers for ``domain``

    If 'resolve' is False, don't resolve names.

    CLI Example:

        salt ns1 dig.NS google.com

    

dnsutil.SPF:

    Return the allowed IPv4 ranges in the SPF record for ``domain``.

    If record is ``SPF`` and the SPF record is empty, the TXT record will be
    searched automatically. If you know the domain uses TXT and not SPF,
    specifying that will save a lookup.

    CLI Example:

        salt ns1 dig.SPF google.com
    

dnsutil.check_ip:

    Check that string ip_addr is a valid IP

    CLI Example:

        salt ns1 dig.check_ip 127.0.0.1
    

dnsutil.hosts_append:

    Append a single line to the /etc/hosts file.

    CLI Example:

        salt '*' dnsutil.hosts_append /etc/hosts 127.0.0.1 ad1.yuk.co,ad2.yuk.co
    

dnsutil.hosts_remove:

    Remove a host from the /etc/hosts file. If doing so will leave a line
    containing only an IP address, then the line will be deleted. This function
    will leave comments and blank lines intact.

    CLI Examples:

        salt '*' dnsutil.hosts_remove /etc/hosts ad1.yuk.co
        salt '*' dnsutil.hosts_remove /etc/hosts ad2.yuk.co,ad1.yuk.co
    

dnsutil.parse_hosts:

    Parse /etc/hosts file.

    CLI Example:

        salt '*' dnsutil.parse_hosts
    

dnsutil.parse_zone:

    Parses a zone file. Can be passed raw zone data on the API level.

    CLI Example:

        salt ns1 dnsutil.parse_zone /var/lib/named/example.com.zone
    

event.fire:

    Fire an event on the local minion event bus. Data must be formed as a dict.

    CLI Example:

        salt '*' event.fire '{"data":"my event data"}' 'tag'
    

event.fire_master:

    Fire an event off up to the master server

    CLI Example:

        salt '*' event.fire_master '{"data":"my event data"}' 'tag'
    

extfs.attributes:

    Return attributes from dumpe2fs for a specified device

    CLI Example:

        salt '*' extfs.attributes /dev/sda1
    

extfs.blocks:

    Return block and inode info from dumpe2fs for a specified device

    CLI Example:

        salt '*' extfs.blocks /dev/sda1
    

extfs.dump:

    Return all contents of dumpe2fs for a specified device

    CLI Example:

        salt '*' extfs.dump /dev/sda1
    

extfs.mkfs:

    Create a file system on the specified device

    CLI Example:

        salt '*' extfs.mkfs /dev/sda1 fs_type=ext4 opts='acl,noexec'

    Valid options are::

        block_size: 1024, 2048 or 4096
        check: check for bad blocks
        direct: use direct IO
        ext_opts: extended file system options (comma-separated)
        fragment_size: size of fragments
        force: setting force to True will cause mke2fs to specify the -F option
               twice (it is already set once); this is truly dangerous
        blocks_per_group: number of blocks in a block group
        number_of_groups: ext4 option for a virtual block group
        bytes_per_inode: set the bytes/inode ratio
        inode_size: size of the inode
        journal: set to True to create a journal (default on ext3/4)
        journal_opts: options for the fs journal (comma separated)
        blocks_file: read bad blocks from file
        label: label to apply to the file system
        reserved: percentage of blocks reserved for super-user
        last_dir: last mounted directory
        test: set to True to not actually create the file system (mke2fs -n)
        number_of_inodes: override default number of inodes
        creator_os: override "creator operating system" field
        opts: mount options (comma separated)
        revision: set the filesystem revision (default 1)
        super: write superblock and group descriptors only
        fs_type: set the filesystem type (REQUIRED)
        usage_type: how the filesystem is going to be used
        uuid: set the UUID for the file system

    See the ``mke2fs(8)`` manpage for a more complete description of these
    options.
    

extfs.tune:

    Set attributes for the specified device (using tune2fs)

    CLI Example:

        salt '*' extfs.tune /dev/sda1 force=True label=wildstallyns opts='acl,noexec'

    Valid options are::

        max: max mount count
        count: mount count
        error: error behavior
        extended_opts: extended options (comma separated)
        force: force, even if there are errors (set to True)
        group: group name or gid that can use the reserved blocks
        interval: interval between checks
        journal: set to True to create a journal (default on ext3/4)
        journal_opts: options for the fs journal (comma separated)
        label: label to apply to the file system
        reserved: percentage of blocks reserved for super-user
        last_dir: last mounted directory
        opts: mount options (comma separated)
        feature: set or clear a feature (comma separated)
        mmp_check: mmp check interval
        reserved: reserved blocks count
        quota_opts: quota options (comma separated)
        time: time last checked
        user: user or uid who can use the reserved blocks
        uuid: set the UUID for the file system

    See the ``mke2fs(8)`` manpage for a more complete description of these
    options.
    

file.access:

    Test whether the Salt process has the specified access to the file. One of
    the following modes must be specified:

        f: Test the existence of the path
        r: Test the readability of the path
        w: Test the writability of the path
        x: Test whether the path can be executed

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.access /path/to/file f
        salt '*' file.access /path/to/file x
    

file.append:

    New in version 0.9.5

    Append text to the end of a file

    CLI Example:

        salt '*' file.append /etc/motd \
                "With all thine offerings thou shalt offer salt." \
                "Salt is what makes things taste bad when it isn't in them."
    

file.blockreplace:

    Replace content of a text block in a file, delimited by line markers

    New in version 2014.1.0 (Hydrogen)

    A block of content delimited by comments can help you manage several lines
    entries without worrying about old entries removal.

    Note:

        This function will store two copies of the file in-memory (the original
        version and the edited version) in order to detect changes and only
        edit the targeted file if necessary.

    path
        Filesystem path to the file to be edited

    marker_start
        The line content identifying a line as the start of the content block.
        Note that the whole line containing this marker will be considered, so
        whitespaces or extra content before or after the marker is included in
        final output

    marker_end
        The line content identifying a line as the end of the content block.
        Note that the whole line containing this marker will be considered, so
        whitespaces or extra content before or after the marker is included in
        final output

    content
        The content to be used between the two lines identified by marker_start
        and marker_stop.

    append_if_not_found : False
        If markers are not found and set to ``True`` then, the markers and
        content will be appended to the file.

    prepend_if_not_found : False
        If markers are not found and set to ``True`` then, the markers and
        content will be prepended to the file.


    backup
        The file extension to use for a backup of the file if any edit is made.
        Set to ``False`` to skip making a backup.

    dry_run
        Don't make any edits to the file.

    show_changes
        Output a unified diff of the old file and the new file. If ``False``,
        return a boolean if any changes were made.

    CLI Example:

        salt '*' file.blockreplace /etc/hosts '#-- start managed zone foobar : DO NOT EDIT --' \
        '#-- end managed zone foobar --' $'10.0.1.1 foo.foobar\n10.0.1.2 bar.foobar' True

    

file.check_file_meta:

    Check for the changes in the file metadata.

    CLI Example:

        salt '*' file.check_file_meta /etc/httpd/conf.d/httpd.conf salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root, root, '755' base
    

file.check_hash:

    Check if a file matches the given hash string

    Returns true if the hash matched, otherwise false. Raises ValueError if
    the hash was not formatted correctly.

    path
        A file path
    hash
        A string in the form <hash_type>=<hash_value>. For example:
        ``md5=e138491e9d5b97023cea823fe17bac22``

    CLI Example:

        salt '*' file.check_hash /etc/fstab md5=<md5sum>
    

file.check_managed:

    Check to see what changes need to be made for a file

    CLI Example:

        salt '*' file.check_managed /etc/httpd/conf.d/httpd.conf salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root, root, '755' jinja True None None base
    

file.check_perms:

    Check the permissions on files and chown if needed

    CLI Example:

        salt '*' file.check_perms /etc/sudoers '{}' root root 400

    Changed in version 2014.1.3
        ``follow_symlinks`` option added
    

file.chgrp:

    Change the group of a file

    CLI Example:

        salt '*' file.chgrp /etc/passwd root
    

file.chown:

    Chown a file, pass the file the desired user and group

    CLI Example:

        salt '*' file.chown /etc/passwd root root
    

file.comment:

    .. deprecated:: 0.17.0
       Use :py:func:`~salt.modules.file.replace` instead.

    Comment out specified lines in a file

    path
        The full path to the file to be edited
    regex
        A regular expression used to find the lines that are to be commented;
        this pattern will be wrapped in parenthesis and will move any
        preceding/trailing ``^`` or ``$`` characters outside the parenthesis
        (e.g., the pattern ``^foo$`` will be rewritten as ``^(foo)$``)
    char : ``#``
        The character to be inserted at the beginning of a line in order to
        comment it out
    backup : ``.bak``
        The file will be backed up before edit with this file extension

        Warning:

            This backup will be overwritten each time ``sed`` / ``comment`` /
            ``uncomment`` is called. Meaning the backup will only be useful
            after the first invocation.

    CLI Example:

        salt '*' file.comment /etc/modules pcspkr
    

file.contains:

    .. deprecated:: 0.17.0
       Use :func:`search` instead.

    Return ``True`` if the file at ``path`` contains ``text``

    CLI Example:

        salt '*' file.contains /etc/crontab 'mymaintenance.sh'
    

file.contains_glob:

    .. deprecated:: 0.17.0
       Use :func:`search` instead.

    Return ``True`` if the given glob matches a string in the named file

    CLI Example:

        salt '*' file.contains_glob /etc/foobar '*cheese*'
    

file.contains_regex:

    .. deprecated:: 0.17.0
       Use :func:`search` instead.

    Return True if the given regular expression matches on any line in the text
    of a given file.

    If the lchar argument (leading char) is specified, it
    will strip `lchar` from the left side of each line before trying to match

    CLI Example:

        salt '*' file.contains_regex /etc/crontab
    

file.contains_regex_multiline:

    .. deprecated:: 0.17.0
       Use :func:`search` instead.

    Return True if the given regular expression matches anything in the text
    of a given file

    Traverses multiple lines at a time, via the salt BufferedReader (reads in
    chunks)

    CLI Example:

        salt '*' file.contains_regex_multiline /etc/crontab '^maint'
    

file.copy:

    Copy a file or directory

    CLI Example:

        salt '*' file.copy /path/to/src /path/to/dst
    

file.delete_backup:

    Restore a previous version of a file that was backed up using Salt's
    :doc:`file state backup </ref/states/backup_mode>` system.

    New in version 0.17.0

    path
        The path on the minion to check for backups
    backup_id
        The numeric id for the backup you wish to delete, as found using
        :mod:`file.list_backups <salt.modules.file.list_backups>`

    CLI Example:

        salt '*' file.restore_backup /foo/bar/baz.txt 0
    

file.directory_exists:

    Tests to see if path is a valid directory.  Returns True/False.

    CLI Example:

        salt '*' file.directory_exists /etc

    

file.extract_hash:

    This routine is called from the :mod:`file.managed
    <salt.states.file.managed>` state to pull a hash from a remote file.
    Regular expressions are used line by line on the ``source_hash`` file, to
    find a potential candidate of the indicated hash type.  This avoids many
    problems of arbitrary file lay out rules. It specifically permits pulling
    hash codes from debian ``*.dsc`` files.

    For example:

        openerp_7.0-latest-1.tar.gz:
          file.managed:
            - name: /tmp/openerp_7.0-20121227-075624-1_all.deb
            - source: http://nightly.openerp.com/7.0/nightly/deb/openerp_7.0-20121227-075624-1.tar.gz
            - source_hash: http://nightly.openerp.com/7.0/nightly/deb/openerp_7.0-20121227-075624-1.dsc

    CLI Example:

        salt '*' file.extract_hash /etc/foo sha512 /path/to/hash/file
    

file.file_exists:

    Tests to see if path is a valid file.  Returns True/False.

    CLI Example:

        salt '*' file.file_exists /etc/passwd

    

file.find:

    Approximate the Unix ``find(1)`` command and return a list of paths that
    meet the specified criteria.

    The options include match criteria::

        name    = path-glob                 # case sensitive
        iname   = path-glob                 # case insensitive
        regex   = path-regex                # case sensitive
        iregex  = path-regex                # case insensitive
        type    = file-types                # match any listed type
        user    = users                     # match any listed user
        group   = groups                    # match any listed group
        size    = [+-]number[size-unit]     # default unit = byte
        mtime   = interval                  # modified since date
        grep    = regex                     # search file contents

    and/or actions::

        delete [= file-types]               # default type = 'f'
        exec    = command [arg ...]         # where {} is replaced by pathname
        print  [= print-opts]

    The default action is 'print=path'.

    file-glob::

        *                = match zero or more chars
        ?                = match any char
        [abc]            = match a, b, or c
        [!abc] or [^abc] = match anything except a, b, and c
        [x-y]            = match chars x through y
        [!x-y] or [^x-y] = match anything except chars x through y
        {a,b,c}          = match a or b or c

    path-regex: a Python re (regular expression) pattern to match pathnames

    file-types: a string of one or more of the following::

        a: all file types
        b: block device
        c: character device
        d: directory
        p: FIFO (named pipe)
        f: plain file
        l: symlink
        s: socket

    users: a space and/or comma separated list of user names and/or uids

    groups: a space and/or comma separated list of group names and/or gids

    size-unit::

        b: bytes
        k: kilobytes
        m: megabytes
        g: gigabytes
        t: terabytes

    interval::

        [<num>w] [<num>d] [<num>h] [<num>m] [<num>s]

        where:
            w: week
            d: day
            h: hour
            m: minute
            s: second

    print-opts: a comma and/or space separated list of one or more of the
    following::

        group: group name
        md5:   MD5 digest of file contents
        mode:  file permissions (as integer)
        mtime: last modification time (as time_t)
        name:  file basename
        path:  file absolute path
        size:  file size in bytes
        type:  file type
        user:  user name

    CLI Examples:

        salt '*' file.find / type=f name=\*.bak size=+10m
        salt '*' file.find /var mtime=+30d size=+10m print=path,size,mtime
        salt '*' file.find /var/log name=\*.[0-9] mtime=+30d size=+10m delete
    

file.get_devmm:

    Get major/minor info from a device

    CLI Example:

       salt '*' file.get_devmm /dev/chr
    

file.get_diff:

    Return unified diff of file compared to file on master

    CLI Example:

        salt '*' file.get_diff /home/fred/.vimrc salt://users/fred/.vimrc
    

file.get_gid:

    Return the id of the group that owns a given file

    CLI Example:

        salt '*' file.get_gid /etc/passwd

    Changed in version 0.16.4
        ``follow_symlinks`` option added
    

file.get_group:

    Return the group that owns a given file

    CLI Example:

        salt '*' file.get_group /etc/passwd

    Changed in version 0.16.4
        ``follow_symlinks`` option added
    

file.get_hash:

    Get the hash sum of a file

    This is better than ``get_sum`` for the following reasons:
        - It does not read the entire file into memory.
        - It does not return a string on error. The returned value of
            ``get_sum`` cannot really be trusted since it is vulnerable to
            collisions: ``get_sum(..., 'xyz') == 'Hash xyz not supported'``

    CLI Example:

        salt '*' file.get_hash /etc/shadow
    

file.get_managed:

    Return the managed file data for file.managed

    CLI Example:

        salt '*' file.get_managed /etc/httpd/conf.d/httpd.conf jinja salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root root '755' base None None
    

file.get_mode:

    Return the mode of a file

    CLI Example:

        salt '*' file.get_mode /etc/passwd

    Changed in version 2014.1.0
        ``follow_symlinks`` option added
    

file.get_selinux_context:

    Get an SELinux context from a given path

    CLI Example:

        salt '*' file.get_selinux_context /etc/hosts
    

file.get_sum:

    Return the sum for the given file, default is md5, sha1, sha224, sha256,
    sha384, sha512 are supported

    CLI Example:

        salt '*' file.get_sum /etc/passwd sha512
    

file.get_uid:

    Return the id of the user that owns a given file

    CLI Example:

        salt '*' file.get_uid /etc/passwd

    Changed in version 0.16.4
        ``follow_symlinks`` option added
    

file.get_user:

    Return the user that owns a given file

    CLI Example:

        salt '*' file.get_user /etc/passwd

    Changed in version 0.16.4
        ``follow_symlinks`` option added
    

file.gid_to_group:

    Convert the group id to the group name on this system

    CLI Example:

        salt '*' file.gid_to_group 0
    

file.grep:

    Grep for a string in the specified file

    Note:
        This function's return value is slated for refinement in future
        versions of Salt

    path
        A file path
    pattern
        A string. For example:
        ``test``
        ``a[0-5]``
    args
        grep options. For example:
        ``" -v"``
        ``" -i -B2"``

    CLI Example:

        salt '*' file.grep /etc/passwd nobody
        salt '*' file.grep /etc/sysconfig/network-scripts/ifcfg-eth0 ipaddr " -i"
        salt '*' file.grep /etc/sysconfig/network-scripts/ifcfg-eth0 ipaddr " -i -B2"
        salt '*' file.grep "/etc/sysconfig/network-scripts/*" ipaddr " -i -l"
    

file.group_to_gid:

    Convert the group to the gid on this system

    CLI Example:

        salt '*' file.group_to_gid root
    

file.is_blkdev:

    Check if a file exists and is a block device.

    CLI Example:

       salt '*' file.is_blkdev /dev/blk
    

file.is_chrdev:

    Check if a file exists and is a character device.

    CLI Example:

       salt '*' file.is_chrdev /dev/chr
    

file.is_fifo:

    Check if a file exists and is a FIFO.

    CLI Example:

       salt '*' file.is_fifo /dev/fifo
    

file.lchown:

    Chown a file, pass the file the desired user and group without following
    symlinks.

    CLI Example:

        salt '*' file.chown /etc/passwd root root
    

file.link:

    Create a hard link to a file

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.link /path/to/file /path/to/link
    

file.list_backup:

    Lists the previous versions of a file backed up using Salt's :doc:`file
    state backup </ref/states/backup_mode>` system.

    New in version 0.17.0

    path
        The path on the minion to check for backups
    limit
        Limit the number of results to the most recent N backups

    CLI Example:

        salt '*' file.list_backups /foo/bar/baz.txt
    

file.list_backups:

    Lists the previous versions of a file backed up using Salt's :doc:`file
    state backup </ref/states/backup_mode>` system.

    New in version 0.17.0

    path
        The path on the minion to check for backups
    limit
        Limit the number of results to the most recent N backups

    CLI Example:

        salt '*' file.list_backups /foo/bar/baz.txt
    

file.lstat:

    Returns the lstat attributes for the given file or dir. Does not support
    symbolic links.

    CLI Example:

    New in version 2014.1.0 (Hydrogen)

        salt '*' file.lstat /path/to/file
    

file.makedirs:

    Ensure that the directory containing this path is available.

    CLI Example:

        salt '*' file.makedirs /opt/code
    

file.makedirs_perms:

    Taken and modified from os.makedirs to set user, group and mode for each
    directory created.

    CLI Example:

        salt '*' file.makedirs_perms /opt/code
    

file.manage_file:

    Checks the destination against what was retrieved with get_managed and
    makes the appropriate modifications (if necessary).

    CLI Example:

        salt '*' file.manage_file /etc/httpd/conf.d/httpd.conf '{}' salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root root '755' base ''
    

file.mkdir:

    Ensure that a directory is available.

    CLI Example:

        salt '*' file.mkdir /opt/jetty/context
    

file.mknod:

    Create a block device, character device, or fifo pipe.
    Identical to the gnu mknod.

    CLI Examples:

      salt '*' file.mknod /dev/chr c 180 31
      salt '*' file.mknod /dev/blk b 8 999
      salt '*' file.nknod /dev/fifo p
    

file.mknod_blkdev:

    Create a block device.

    CLI Example:

       salt '*' file.mknod_blkdev /dev/blk 8 999
    

file.mknod_chrdev:

    Create a character device.

    CLI Example:

       salt '*' file.mknod_chrdev /dev/chr 180 31
    

file.mknod_fifo:

    Create a FIFO pipe.

    CLI Example:

       salt '*' file.mknod_fifo /dev/fifo
    

file.patch:

    New in version 0.10.4

    Apply a patch to a file

    Equivalent to::

        patch <options> <originalfile> <patchfile>

    originalfile
        The full path to the file or directory to be patched
    patchfile
        A patch file to apply to ``originalfile``
    options
        Options to pass to patch.

    CLI Example:

        salt '*' file.patch /opt/file.txt /tmp/file.txt.patch
    

file.psed:

    .. deprecated:: 0.17.0
       Use :py:func:`~salt.modules.file.replace` instead.

    Make a simple edit to a file (pure Python version)

    Equivalent to::

        sed <backup> <options> "/<limit>/ s/<before>/<after>/<flags> <file>"

    path
        The full path to the file to be edited
    before
        A pattern to find in order to replace with ``after``
    after
        Text that will replace ``before``
    limit : ``''``
        An initial pattern to search for before searching for ``before``
    backup : ``.bak``
        The file will be backed up before edit with this file extension;
        **WARNING:** each time ``sed``/``comment``/``uncomment`` is called will
        overwrite this backup
    flags : ``gMS``
        Flags to modify the search. Valid values are:
          - ``g``: Replace all occurrences of the pattern, not just the first.
          - ``I``: Ignore case.
          - ``L``: Make ``\w``, ``\W``, ``\b``, ``\B``, ``\s`` and ``\S``
            dependent on the locale.
          - ``M``: Treat multiple lines as a single line.
          - ``S``: Make `.` match all characters, including newlines.
          - ``U``: Make ``\w``, ``\W``, ``\b``, ``\B``, ``\d``, ``\D``,
            ``\s`` and ``\S`` dependent on Unicode.
          - ``X``: Verbose (whitespace is ignored).
    multi: ``False``
        If True, treat the entire file as a single line

    Forward slashes and single quotes will be escaped automatically in the
    ``before`` and ``after`` patterns.

    CLI Example:

        salt '*' file.sed /etc/httpd/httpd.conf 'LogLevel warn' 'LogLevel info'
    

file.readdir:

    Return a list containing the contents of a directory

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.readdir /path/to/dir/
    

file.readlink:

    Return the path that a symlink points to

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.readlink /path/to/link
    

file.remove:

    Remove the named file

    CLI Example:

        salt '*' file.remove /tmp/foo
    

file.remove_backup:

    Restore a previous version of a file that was backed up using Salt's
    :doc:`file state backup </ref/states/backup_mode>` system.

    New in version 0.17.0

    path
        The path on the minion to check for backups
    backup_id
        The numeric id for the backup you wish to delete, as found using
        :mod:`file.list_backups <salt.modules.file.list_backups>`

    CLI Example:

        salt '*' file.restore_backup /foo/bar/baz.txt 0
    

file.rename:

    Rename a file or directory

    CLI Example:

        salt '*' file.rename /path/to/src /path/to/dst
    

file.replace:

    Replace occurances of a pattern in a file

    New in version 0.17.0

    This is a pure Python implementation that wraps Python's :py:func:`~re.sub`.

    :param path: Filesystem path to the file to be edited
    :param pattern: The PCRE search
    :param repl: The replacement text
    :param count: Maximum number of pattern occurrences to be replaced
    :param flags: A list of flags defined in the :ref:`re module documentation
        <contents-of-module-re>`. Each list item should be a string that will
        correlate to the human-friendly flag name. E.g., ``['IGNORECASE',
        'MULTILINE']``. Note: multiline searches must specify ``file`` as the
        ``bufsize`` argument below.

    :type flags: list or int
    :param bufsize: How much of the file to buffer into memory at once. The
        default value ``1`` processes one line at a time. The special value
        ``file`` may be specified which will read the entire file into memory
        before processing. Note: multiline searches must specify ``file``
        buffering.
    :type bufsize: int or str
    :param backup: The file extension to use for a backup of the file before
        editing. Set to ``False`` to skip making a backup.
    :param dry_run: Don't make any edits to the file
    :param search_only: Just search for the pattern; ignore the replacement;
        stop on the first match
    :param show_changes: Output a unified diff of the old file and the new
        file. If ``False`` return a boolean if any changes were made.
        Note: using this option will store two copies of the file in-memory
        (the original version and the edited version) in order to generate the
        diff.

    :rtype: bool or str

    CLI Example:

        salt '*' file.replace /etc/httpd/httpd.conf 'LogLevel warn' 'LogLevel info'
        salt '*' file.replace /some/file 'before' 'after' flags='[MULTILINE, IGNORECASE]'
    

file.restore_backup:

    Restore a previous version of a file that was backed up using Salt's
    :doc:`file state backup </ref/states/backup_mode>` system.

    New in version 0.17.0

    path
        The path on the minion to check for backups
    backup_id
        The numeric id for the backup you wish to restore, as found using
        :mod:`file.list_backups <salt.modules.file.list_backups>`

    CLI Example:

        salt '*' file.restore_backup /foo/bar/baz.txt 0
    

file.restorecon:

    Reset the SELinux context on a given path

    CLI Example:

         salt '*' file.restorecon /home/user/.ssh/authorized_keys
    

file.rmdir:

    Remove the specified directory. Fails if a directory is not empty.

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.rmdir /tmp/foo/
    

file.search:

    Search for occurances of a pattern in a file

    New in version 0.17.0

    Params are identical to :py:func:`~salt.modules.file.replace`.

    CLI Example:

        salt '*' file.search /etc/crontab 'mymaintenance.sh'
    

file.sed:

    .. deprecated:: 0.17.0
       Use :py:func:`~salt.modules.file.replace` instead.

    Make a simple edit to a file

    Equivalent to::

        sed <backup> <options> "/<limit>/ s/<before>/<after>/<flags> <file>"

    path
        The full path to the file to be edited
    before
        A pattern to find in order to replace with ``after``
    after
        Text that will replace ``before``
    limit : ``''``
        An initial pattern to search for before searching for ``before``
    backup : ``.bak``
        The file will be backed up before edit with this file extension;
        **WARNING:** each time ``sed``/``comment``/``uncomment`` is called will
        overwrite this backup
    options : ``-r -e``
        Options to pass to sed
    flags : ``g``
        Flags to modify the sed search; e.g., ``i`` for case-insensitve pattern
        matching
    negate_match : False
        Negate the search command (``!``)

        New in version 0.17.0

    Forward slashes and single quotes will be escaped automatically in the
    ``before`` and ``after`` patterns.

    CLI Example:

        salt '*' file.sed /etc/httpd/httpd.conf 'LogLevel warn' 'LogLevel info'
    

file.sed_contains:

    .. deprecated:: 0.17.0
       Use :func:`search` instead.

    Return True if the file at ``path`` contains ``text``. Utilizes sed to
    perform the search (line-wise search).

    Note: the ``p`` flag will be added to any flags you pass in.

    CLI Example:

        salt '*' file.contains /etc/crontab 'mymaintenance.sh'
    

file.seek_read:

    Seek to a position on a file and write to it

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.seek_read /path/to/file 4096 0
    

file.seek_write:

    Seek to a position on a file and write to it

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.seek_write /path/to/file 'some data' 4096
    

file.set_mode:

    Set the mode of a file

    CLI Example:

        salt '*' file.set_mode /etc/passwd 0644
    

file.set_selinux_context:

    Set a specific SELinux label on a given path

    CLI Example:

        salt '*' file.set_selinux_context path <role> <type> <range>
    

file.source_list:

    Check the source list and return the source to use

    CLI Example:

        salt '*' file.source_list salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' base
    

file.stats:

    Return a dict containing the stats for a given file

    CLI Example:

        salt '*' file.stats /etc/passwd
    

file.statvfs:

    Perform a statvfs call against the filesystem that the file resides on

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.statvfs /path/to/file
    

file.symlink:

    Create a symbolic link to a file

    CLI Example:

        salt '*' file.symlink /path/to/file /path/to/link
    

file.touch:

    New in version 0.9.5

    Just like the ``touch`` command, create a file if it doesn't exist or
    simply update the atime and mtime if it already does.

    atime:
        Access time in Unix epoch time
    mtime:
        Last modification in Unix epoch time

    CLI Example:

        salt '*' file.touch /var/log/emptyfile
    

file.truncate:

    Seek to a position on a file and write to it

    New in version 2014.1.0 (Hydrogen)

    CLI Example:

        salt '*' file.truncate /path/to/file 512
    

file.uid_to_user:

    Convert a uid to a user name

    CLI Example:

        salt '*' file.uid_to_user 0
    

file.uncomment:

    .. deprecated:: 0.17.0
       Use :py:func:`~salt.modules.file.replace` instead.

    Uncomment specified commented lines in a file

    path
        The full path to the file to be edited
    regex
        A regular expression used to find the lines that are to be uncommented.
        This regex should not include the comment character. A leading ``^``
        character will be stripped for convenience (for easily switching
        between comment() and uncomment()).
    char : ``#``
        The character to remove in order to uncomment a line
    backup : ``.bak``
        The file will be backed up before edit with this file extension;
        **WARNING:** each time ``sed``/``comment``/``uncomment`` is called will
        overwrite this backup

    CLI Example:

        salt '*' file.uncomment /etc/hosts.deny 'ALL: PARANOID'
    

file.user_to_uid:

    Convert user name to a uid

    CLI Example:

        salt '*' file.user_to_uid root
    

gem.install:

    Installs one or several gems.

    gems
        The gems to install
    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.
    version : None
        Specify the version to install for the gem.
        Doesn't play nice with multiple gems at once
    rdoc : False
        Generate RDoc documentation for the gem(s).
    ri : False
        Generate RI documentation for the gem(s).

    CLI Example:

        salt '*' gem.install vagrant
    

gem.list:

    List locally installed gems.

    prefix :
        Only list gems when the name matches this prefix.
    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.

    CLI Example:

        salt '*' gem.list
    

gem.sources_add:

    Add a gem source.

    source_uri
        The source URI to add.
    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.

    CLI Example:

        salt '*' gem.sources_add http://rubygems.org/
    

gem.sources_list:

    List the configured gem sources.

    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.

    CLI Example:

        salt '*' gem.sources_list
    

gem.sources_remove:

    Remove a gem source.

    source_uri
        The source URI to remove.
    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.

    CLI Example:

        salt '*' gem.sources_remove http://rubygems.org/
    

gem.uninstall:

    Uninstall one or several gems.

    gems
        The gems to uninstall.
    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.

    CLI Example:

        salt '*' gem.uninstall vagrant
    

gem.update:

    Update one or several gems.

    gems
        The gems to update.
    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.

    CLI Example:

        salt '*' gem.update vagrant
    

gem.update_system:

    Update rubygems.

    version : (newest)
        The version of rubygems to install.
    ruby : None
        If RVM is installed, the ruby version and gemset to use.
    runas : None
        The user to run gem as.

    CLI Example:

        salt '*' gem.update_system
    

git.add:

    add a file to git

    cwd
        The path to the Git repository

    file_name
        Path to the file in the cwd

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.add /path/to/git/repo /path/to/file

    

git.archive:

    Export a tarball from the repository

    cwd
        The path to the Git repository

    output
        The path to the archive tarball

    rev: HEAD
        The revision to create an archive from

    fmt: None
        Format of the resulting archive, zip and tar are commonly used

    prefix : None
        Prepend <prefix>/ to every filename in the archive

    user : None
        Run git as a user other than what the minion runs as

    If ``prefix`` is not specified it defaults to the basename of the repo
    directory.

    CLI Example:

        salt '*' git.archive /path/to/repo /path/to/archive.tar.gz
    

git.checkout:

    Checkout a given revision

    cwd
        The path to the Git repository

    rev
        The remote branch or revision to checkout

    force : False
        Force a checkout even if there might be overwritten changes

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Examples:

        salt '*' git.checkout /path/to/repo somebranch user=jeff

        salt '*' git.checkout /path/to/repo opts='testbranch -- conf/file1 file2'

        salt '*' git.checkout /path/to/repo rev=origin/mybranch opts=--track
    

git.clone:

    Clone a new repository

    cwd
        The path to the Git repository

    repository
        The git URI of the repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    identity : None
        A path to a private key to use over SSH

    CLI Example:

        salt '*' git.clone /path/to/repo git://github.com/saltstack/salt.git

        salt '*' git.clone /path/to/repo.git\
                git://github.com/saltstack/salt.git '--bare --origin github'

    

git.commit:

    create a commit

    cwd
        The path to the Git repository

    message
        The commit message

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.commit /path/to/git/repo 'The commit message'
    

git.config_get:

    Get a key from the git configuration file (.git/config) of the repository.

    cwd
        The path to the Git repository

    setting_name
        The name of the configuration key to get

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.config_get /path/to/repo user.email
    

git.config_set:

    Set a key in the git configuration file (.git/config) of the repository or
    globally.

    cwd
        The path to the Git repository

    setting_name
        The name of the configuration key to set

    setting_value
        The (new) value to set

    user : None
        Run git as a user other than what the minion runs as

    is_global : False
        Set to True to use the '--global' flag with 'git config'

    CLI Example:

        salt '*' git.config_set /path/to/repo user.email me@example.com
    

git.current_branch:

    Returns the current branch name, if on a branch.

    CLI Example:

        salt '*' git.current_branch /path/to/repo
    

git.describe:

    Returns the git describe string (or the SHA hash if there are no tags) for
    the given revision

    cwd
        The path to the Git repository

    rev: HEAD
        The revision to describe

    user : None
        Run git as a user other than what the minion runs as

    CLI Examples:

        salt '*' git.describe /path/to/repo

        salt '*' git.describe /path/to/repo develop
    

git.fetch:

    Perform a fetch on the given repository

    cwd
        The path to the Git repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    identity : None
        A path to a private key to use over SSH

    CLI Example:

        salt '*' git.fetch /path/to/repo '--all'

        salt '*' git.fetch cwd=/path/to/repo opts='--all' user=johnny
    

git.init:

    Initialize a new git repository

    cwd
        The path to the Git repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.init /path/to/repo.git opts='--bare'
    

git.ls_remote:

    Returns the upstream hash for any given URL and branch.

    cwd
        The path to the Git repository

    repository: origin
        The name of the repository to get the revision from. Can be the name of
        a remote, an URL, etc.

    branch: master
        The name of the branch to get the revision from.

    user : none
        run git as a user other than what the minion runs as

    identity : none
        a path to a private key to use over ssh

    CLI Example:

        salt '*' git.ls_remote /pat/to/repo origin master

    

git.merge:

    Merge a given branch

    cwd
        The path to the Git repository

    branch : @{upstream}
        The remote branch or revision to merge into the current branch

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.fetch /path/to/repo
        salt '*' git.merge /path/to/repo @{upstream}
    

git.pull:

    Perform a pull on the given repository

    cwd
        The path to the Git repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    identity : None
        A path to a private key to use over SSH

    CLI Example:

        salt '*' git.pull /path/to/repo opts='--rebase origin master'
    

git.push:

    Push to remote

    cwd
        The path to the Git repository

    remote_name
        Name of the remote to push to

    branch : master
        Name of the branch to push

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    identity : None
        A path to a private key to use over SSH


    CLI Example:

        salt '*' git.push /path/to/git/repo remote-name
    

git.rebase:

    Rebase the current branch

    cwd
        The path to the Git repository

    rev : master
        The revision to rebase onto the current branch

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.rebase /path/to/repo master
        salt '*' git.rebase /path/to/repo 'origin master'

    That is the same as:

        git rebase master
        git rebase origin master
    

git.remote_get:

    get the fetch and push URL for a specified remote name

    remote : origin
        the remote name used to define the fetch and push URL

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.remote_get /path/to/repo
        salt '*' git.remote_get /path/to/repo upstream
    

git.remote_set:

    sets a remote with name and URL like git remote add <remote_name> <remote_url>

    remote_name : origin
        defines the remote name

    remote_url : None
        defines the remote URL; should not be None!

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.remote_set /path/to/repo remote_url=git@github.com:saltstack/salt.git
        salt '*' git.remote_set /path/to/repo origin git@github.com:saltstack/salt.git
    

git.remotes:

    Get remotes like git remote -v

    cwd
        The path to the Git repository

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.remotes /path/to/repo
    

git.reset:

    Reset the repository checkout

    cwd
        The path to the Git repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.reset /path/to/repo master
    

git.revision:

    Returns the long hash of a given identifier (hash, branch, tag, HEAD, etc)

    cwd
        The path to the Git repository

    rev: HEAD
        The revision

    short: False
        Return an abbreviated SHA1 git hash

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.revision /path/to/repo mybranch
    

git.rm:

    Remove a file from git

    cwd
        The path to the Git repository

    file_name
        Path to the file in the cwd

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.rm /path/to/git/repo /path/to/file
    

git.stash:

    Stash changes in the repository checkout

    cwd
        The path to the Git repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.stash /path/to/repo master
    

git.status:

    Return the status of the repository. The returned format uses the status
    codes of gits 'porcelain' output mode

    cwd
        The path to the Git repository

    user : None
        Run git as a user other than what the minion runs as

    CLI Example:

        salt '*' git.status /path/to/git/repo
    

git.submodule:

    Initialize git submodules

    cwd
        The path to the Git repository

    init : True
        Ensure that new submodules are initialized

    opts : None
        Any additional options to add to the command line

    user : None
        Run git as a user other than what the minion runs as

    identity : None
        A path to a private key to use over SSH

    CLI Example:

        salt '*' git.submodule /path/to/repo.git/sub/repo
    

grains.append:

    New in version 0.17.0

    Append a value to a list in the grains config file

    CLI Example:

        salt '*' grains.append key val
    

grains.delval:

    New in version 0.17.0

    Delete a grain from the grains config file

    :param Destructive: Delete the key, too. Defaults to False.

    CLI Example:

        salt '*' grains.delval key
    

grains.filter_by:

    New in version 0.17.0

    Look up the given grain in a given dictionary for the current OS and return
    the result

    Although this may occasionally be useful at the CLI, the primary intent of
    this function is for use in Jinja to make short work of creating lookup
    tables for OS-specific data. For example:

        {% set apache = salt['grains.filter_by']({
            'Debian': {'pkg': 'apache2', 'srv': 'apache2'},
            'RedHat': {'pkg': 'httpd', 'srv': 'httpd'},
            'default': 'Debian',
        }) %}

        myapache:
          pkg:
            - installed
            - name: {{ apache.pkg }}
          service:
            - running
            - name: {{ apache.srv }}

    Values in the lookup table may be overridden by values in Pillar. An
    example Pillar to override values in the example above could be as follows:

        apache:
          lookup:
            pkg: apache_13
            srv: apache

    The call to ``filter_by()`` would be modified as follows to reference those
    Pillar values:

        {% set apache = salt['grains.filter_by']({
            ...
        }, merge=salt['pillar.get']('apache:lookup')) %}


    :param lookup_dict: A dictionary, keyed by a grain, containing a value or
        values relevant to systems matching that grain. For example, a key
        could be the grain for an OS and the value could the name of a package
        on that particular OS.
    :param grain: The name of a grain to match with the current system's
        grains. For example, the value of the "os_family" grain for the current
        system could be used to pull values from the ``lookup_dict``
        dictionary.
    :param merge: A dictionary to merge with the ``lookup_dict`` before doing
        the lookup. This allows Pillar to override the values in the
        ``lookup_dict``. This could be useful, for example, to override the
        values for non-standard package names such as when using a different
        Python version from the default Python version provided by the OS
        (e.g., ``python26-mysql`` instead of ``python-mysql``).
    :param default: default lookup_dict's key used if the grain does not exists
         or if the grain value has no match on lookup_dict.

         New in version 2014.1

    CLI Example:

        salt '*' grains.filter_by '{Debian: Debheads rule, RedHat: I love my hat}'
        # this one will render {D: {E: I, G: H}, J: K}
        salt '*' grains.filter_by '{A: B, C: {D: {E: F,G: H}}}' 'xxx' '{D: {E: I},J: K}' 'C'
    

grains.get:

    Attempt to retrieve the named value from grains, if the named value is not
    available return the passed default. The default return is an empty string.

    The value can also represent a value in a nested dict using a ":" delimiter
    for the dict. This means that if a dict in grains looks like this::

        {'pkg': {'apache': 'httpd'}}

    To retrieve the value associated with the apache key in the pkg dict this
    key can be passed::

        pkg:apache

    CLI Example:

        salt '*' grains.get pkg:apache
    

grains.get_or_set_hash:

    Perform a one-time generation of a hash and write it to the local grains.
    If that grain has already been set return the value instead.

    This is useful for generating passwords or keys that are specific to a
    single minion that don't need to be stored somewhere centrally.

    State Example:

        some_mysql_user:
          mysql_user:
            - present
            - host: localhost
            - password: {{ grains.get_or_set_hash('mysql:some_mysql_user') }}

    CLI Example:

        salt '*' grains.get_or_set_hash 'django:SECRET_KEY' 50
    

grains.has_value:

    Determine whether a named value exists in the grains dictionary.

    Given a grains dictionary that contains the following structure::

        {'pkg': {'apache': 'httpd'}}

    One would determine if the apache key in the pkg dict exists by::

        pkg:apache

    CLI Example:

        salt '*' grains.has_value pkg:apache
    

grains.item:

    Return one or more grains

    CLI Example:

        salt '*' grains.item os
        salt '*' grains.item os osrelease oscodename

    Sanitized CLI Example:

        salt '*' grains.item host sanitize=True
    

grains.items:

    Return all of the minion's grains

    CLI Example:

        salt '*' grains.items

    Sanitized CLI Example:

        salt '*' grains.items sanitize=True
    

grains.ls:

    Return a list of all available grains

    CLI Example:

        salt '*' grains.ls
    

grains.remove:

    New in version 0.17.0

    Remove a value from a list in the grains config file

    CLI Example:

        salt '*' grains.remove key val
    

grains.setval:

    Set a grains value in the grains config file

    :param Destructive: If an operation results in a key being removed, delete the key, too. Defaults to False.

    CLI Example:

        salt '*' grains.setval key val
        salt '*' grains.setval key "{'sub-key': 'val', 'sub-key2': 'val2'}"
    

group.add:

    Add the specified group

    CLI Example:

        salt '*' group.add foo 3456
    

group.chgid:

    Change the gid for a named group

    CLI Example:

        salt '*' group.chgid foo 4376
    

group.delete:

    Remove the named group

    CLI Example:

        salt '*' group.delete foo
    

group.getent:

    Return info on all groups

    CLI Example:

        salt '*' group.getent
    

group.info:

    Return information about a group

    CLI Example:

        salt '*' group.info foo
    

grub.conf:

    Parse GRUB conf file

    CLI Example:

        salt '*' grub.conf
    

grub.version:

    Return server version from grub --version

    CLI Example:

        salt '*' grub.version
    

hg.archive:

    Export a tarball from the repository

    cwd
        The path to the Mercurial repository

    output
        The path to the archive tarball

    rev: tip
        The revision to create an archive from

    fmt: None
        Format of the resulting archive. Mercurial supports: tar,
        tbz2, tgz, zip, uzip, and files formats.

    prefix : None
        Prepend <prefix>/ to every filename in the archive

    user : None
        Run hg as a user other than what the minion runs as

    If ``prefix`` is not specified it defaults to the basename of the repo
    directory.

    CLI Example:

        salt '*' hg.archive /path/to/repo output=/tmp/archive.tgz fmt=tgz
    

hg.clone:

    Clone a new repository

    cwd
        The path to the Mercurial repository

    repository
        The hg URI of the repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run hg as a user other than what the minion runs as

    CLI Example:

        salt '*' hg.clone /path/to/repo https://bitbucket.org/birkenfeld/sphinx
    

hg.describe:

    Mimick git describe and return an identifier for the given revision

    cwd
        The path to the Mercurial repository

    rev: tip
        The path to the archive tarball

    user : None
        Run hg as a user other than what the minion runs as

    CLI Example:

        salt '*' hg.describe /path/to/repo
    

hg.pull:

    Perform a pull on the given repository

    cwd
        The path to the Mercurial repository

    opts : None
        Any additional options to add to the command line

    user : None
        Run hg as a user other than what the minion runs as

    CLI Example:

        salt '*' hg.pull /path/to/repo '-u'
    

hg.revision:

    Returns the long hash of a given identifier (hash, branch, tag, HEAD, etc)

    cwd
        The path to the Mercurial repository

    rev: tip
        The revision

    short: False
        Return an abbreviated commit hash

    user : None
        Run hg as a user other than what the minion runs as

    CLI Example:

        salt '*' hg.revision /path/to/repo mybranch
    

hg.update:

    Update to a given revision

    cwd
        The path to the Mercurial repository

    rev
        The revision to update to

    force : False
        Force an update

    user : None
        Run hg as a user other than what the minion runs as

    CLI Example:

        salt devserver1 hg.update /path/to/repo somebranch
    

hosts.add_host:

    Add a host to an existing entry, if the entry is not in place then create
    it with the given host

    CLI Example:

        salt '*' hosts.add_host <ip> <alias>
    

hosts.get_alias:

    Return the list of aliases associated with an ip

    CLI Example:

        salt '*' hosts.get_alias <ip addr>
    

hosts.get_ip:

    Return the ip associated with the named host

    CLI Example:

        salt '*' hosts.get_ip <hostname>
    

hosts.has_pair:

    Return true if the alias is set

    CLI Example:

        salt '*' hosts.has_pair <ip> <alias>
    

hosts.list_hosts:

    Return the hosts found in the hosts file in this format::

        {'<ip addr>': ['alias1', 'alias2', ...]}

    CLI Example:

        salt '*' hosts.list_hosts
    

hosts.rm_host:

    Remove a host entry from the hosts file

    CLI Example:

        salt '*' hosts.rm_host <ip> <alias>
    

hosts.set_host:

    Set the host entry in the hosts file for the given ip, this will overwrite
    any previous entry for the given ip

    CLI Example:

        salt '*' hosts.set_host <ip> <alias>
    

img.bootstrap:

    HIGHLY EXPERIMENTAL
    Bootstrap a virtual machine image

    location:
        The location to create the image

    size:
        The size of the image to create in megabytes

    fmt:
        The image format, raw or qcow2

    CLI Example:

        salt '*' qemu_nbd.bootstrap /srv/salt-images/host.qcow 4096 qcow2
    

img.mnt_image:

    Mount the named image and return the mount point

    CLI Example:

        salt '*' img.mount_image /tmp/foo
    

img.mount_image:

    Mount the named image and return the mount point

    CLI Example:

        salt '*' img.mount_image /tmp/foo
    

img.umount_image:

    Unmount an image mountpoint

    CLI Example:

        salt '*' img.umount_image /mnt/foo
    

incron.list_tab:

    Return the contents of the specified user's incrontab

    CLI Example:

        salt '*' incron.list_tab root
    

incron.ls:

    Return the contents of the specified user's incrontab

    CLI Example:

        salt '*' incron.list_tab root
    

incron.raw_incron:

    Return the contents of the user's incrontab

    CLI Example:

        salt '*' incron.raw_cron root
    

incron.raw_system_incron:

    Return the contents of the system wide incrontab

    CLI Example:

        salt '*' incron.raw_system_cron
    

incron.rm:

    Remove a cron job for a specified user. If any of the day/time params are
    specified, the job will only be removed if the specified params match.

    CLI Example:

        salt '*' incron.rm_job root /path
    

incron.rm_job:

    Remove a cron job for a specified user. If any of the day/time params are
    specified, the job will only be removed if the specified params match.

    CLI Example:

        salt '*' incron.rm_job root /path
    

incron.set_job:

    Sets a cron job up for a specified user.

    CLI Example:

        salt '*' incron.set_job root '/root' 'IN_MODIFY' 'echo "$$ $@ $# $% $&"'
    

incron.write_cron_file_verbose:

    Writes the contents of a file to a user's crontab and return error message on error

    CLI Example:

        salt '*' incron.write_incron_file_verbose root /tmp/new_cron
    

incron.write_incron_file:

    Writes the contents of a file to a user's crontab

    CLI Example:

        salt '*' incron.write_cron_file root /tmp/new_cron
    

ini.get_option:

    Get value of a key from a section in a ini file

    from api:
    import salt
    sc = salt.client.LocalClient()
    sc.cmd('target', 'ini.get_option',
           [path_to_ini_file, section_name, option])

    CLI Example:

        salt '*' ini.get_option /path/to/ini section_name option_name
    

ini.get_section:

    get a section in a ini file
    returns the section as dictionary

    from api:
    import salt
    sc = salt.client.LocalClient()
    sc.cmd('target', 'ini.get_section',
           [path_to_ini_file, section_name])

    CLI Example:

        salt '*' ini.get_section /path/to/ini section_name
    

ini.remove_option:

    Remove a key,value pair from a section in a ini file
    returns the value of the removed key

    from api:
    import salt
    sc = salt.client.LocalClient()
    sc.cmd('target', 'ini.remove_option',
           [path_to_ini_file, section_name, option])

    CLI Example:

        salt '*' ini.remove_option /path/to/ini section_name option_name
    

ini.remove_section:

    remove a section in a ini file
    returns the removed section as dictionary

    from api:
    import salt
    sc = salt.client.LocalClient()
    sc.cmd('target', 'ini.remove_section',
           [path_to_ini_file, section_name])

    CLI Example:

        salt '*' ini.remove_section /path/to/ini section_name
    

ini.set_option:

    Edit ini files
    file_name: path of ini_file
    sections: a dictionary representing the ini file

    returns a dictionary containing the changes made

    set summary=False if return data need not have previous option value

    from api:
    import salt
    sc = salt.client.LocalClient()
    sc.cmd('target', 'ini.set_option',
           ['path_to_ini_file', '{"section_to_change": {"key": "value"}}'])

    CLI Example:

        salt '*' ini.set_option /path/to/ini '{section_foo: {key: value}}'
    

ip.apply_network_settings:

    Apply global network configuration.

    CLI Example:

        salt '*' ip.apply_network_settings
    

ip.build_bond:

    Create a bond script in /etc/modprobe.d with the passed settings
    and load the bonding kernel module.

    CLI Example:

        salt '*' ip.build_bond bond0 mode=balance-alb
    

ip.build_interface:

    Build an interface script for a network interface.

    CLI Example:

        salt '*' ip.build_interface eth0 eth <settings>
    

ip.build_network_settings:

    Build the global network script.

    CLI Example:

        salt '*' ip.build_network_settings <settings>
    

ip.build_routes:

    Build a route script for a network interface.

    CLI Example:

        salt '*' ip.build_routes eth0 <settings>
    

ip.down:

    Shutdown a network interface

    CLI Example:

        salt '*' ip.down eth0
    

ip.get_bond:

    Return the content of a bond script

    CLI Example:

        salt '*' ip.get_bond bond0
    

ip.get_interface:

    Return the contents of an interface script

    CLI Example:

        salt '*' ip.get_interface eth0
    

ip.get_network_settings:

    Return the contents of the global network script.

    CLI Example:

        salt '*' ip.get_network_settings
    

ip.get_routes:

    Return the contents of the interface routes script.

    CLI Example:

        salt '*' ip.get_routes eth0
    

ip.up:

    Start up a network interface

    CLI Example:

        salt '*' ip.up eth0
    

iptables.append:

    Append a rule to the specified table/chain.

    This function accepts a rule in a standard iptables command format,
        starting with the chain. Trying to force users to adapt to a new
        method of creating rules would be irritating at best, and we
        already have a parser that can handle it.

    CLI Example:

        salt '*' iptables.append filter INPUT \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'

        IPv6:
        salt '*' iptables.append filter INPUT \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \
            family=ipv6
    

iptables.build_rule:

    Build a well-formatted iptables rule based on kwargs. Long options must be
    used (`--jump` instead of `-j`) because they will have the `--` added to
    them. A `table` and `chain` are not required, unless `full` is True.

    If `full` is `True`, then `table`, `chain` and `command` are required.
    `command` may be specified as either a short option ('I') or a long option
    (`--insert`). This will return the iptables command, exactly as it would
    be used from the command line.

    If a position is required (as with `-I` or `-D`), it may be specified as
    `position`. This will only be useful if `full` is True.

    If `connstate` is passed in, it will automatically be changed to `state`.

    CLI Examples:

        salt '*' iptables.build_rule match=state \
            connstate=RELATED,ESTABLISHED jump=ACCEPT
        salt '*' iptables.build_rule filter INPUT command=I position=3 \
            full=True match=state state=RELATED,ESTABLISHED jump=ACCEPT

        IPv6:
        salt '*' iptables.build_rule match=state \
            connstate=RELATED,ESTABLISHED jump=ACCEPT \
            family=ipv6
        salt '*' iptables.build_rule filter INPUT command=I position=3 \
            full=True match=state state=RELATED,ESTABLISHED jump=ACCEPT \
            family=ipv6

    

iptables.check:

    Check for the existance of a rule in the table and chain

    This function accepts a rule in a standard iptables command format,
        starting with the chain. Trying to force users to adapt to a new
        method of creating rules would be irritating at best, and we
        already have a parser that can handle it.

    CLI Example:

        salt '*' iptables.check filter INPUT \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'

        IPv6:
        salt '*' iptables.check filter INPUT \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \
            family=ipv6
    

iptables.check_chain:

    New in version 2014.1.0 (Hydrogen)

    Check for the existance of a chain in the table

    CLI Example:

        salt '*' iptables.check_chain filter INPUT

        IPv6:
        salt '*' iptables.check_chain filter INPUT family=ipv6
    

iptables.delete:

    Delete a rule from the specified table/chain, specifying either the rule
        in its entirety, or the rule's position in the chain.

    This function accepts a rule in a standard iptables command format,
        starting with the chain. Trying to force users to adapt to a new
        method of creating rules would be irritating at best, and we
        already have a parser that can handle it.

    CLI Examples:

        salt '*' iptables.delete filter INPUT position=3
        salt '*' iptables.delete filter INPUT \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'

        IPv6:
        salt '*' iptables.delete filter INPUT position=3 family=ipv6
        salt '*' iptables.delete filter INPUT \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \
            family=ipv6
    

iptables.delete_chain:

    New in version 2014.1.0 (Hydrogen)

    Delete custom chain to the specified table.

    CLI Example:

        salt '*' iptables.delete_chain filter CUSTOM_CHAIN

        IPv6:
        salt '*' iptables.delete_chain filter CUSTOM_CHAIN family=ipv6
    

iptables.flush:

    Flush the chain in the specified table, flush all chains in the specified
    table if not specified chain.

    CLI Example:

        salt '*' iptables.flush filter INPUT

        IPv6:
        salt '*' iptables.flush filter INPUT family=ipv6
    

iptables.get_policy:

    Return the current policy for the specified table/chain

    CLI Example:

        salt '*' iptables.get_policy filter INPUT

        IPv6:
        salt '*' iptables.get_policy filter INPUT family=ipv6
    

iptables.get_rules:

    Return a data structure of the current, in-memory rules

    CLI Example:

        salt '*' iptables.get_rules

        IPv6:
        salt '*' iptables.get_rules family=ipv6

    

iptables.get_saved_policy:

    Return the current policy for the specified table/chain

    CLI Examples:

        salt '*' iptables.get_saved_policy filter INPUT
        salt '*' iptables.get_saved_policy filter INPUT \
            conf_file=/etc/iptables.saved

        IPv6:
        salt '*' iptables.get_saved_policy filter INPUT family=ipv6
        salt '*' iptables.get_saved_policy filter INPUT \
            conf_file=/etc/iptables.saved family=ipv6

    

iptables.get_saved_rules:

    Return a data structure of the rules in the conf file

    CLI Example:

        salt '*' iptables.get_saved_rules

        IPv6:
        salt '*' iptables.get_saved_rules family=ipv6
    

iptables.insert:

    Insert a rule into the specified table/chain, at the specified position.

    This function accepts a rule in a standard iptables command format,
        starting with the chain. Trying to force users to adapt to a new
        method of creating rules would be irritating at best, and we
        already have a parser that can handle it.

    CLI Examples:

        salt '*' iptables.insert filter INPUT position=3 \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'

        IPv6:
        salt '*' iptables.insert filter INPUT position=3 \
            rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \
            family=ipv6
    

iptables.new_chain:

    New in version 2014.1.0 (Hydrogen)

    Create new custom chain to the specified table.

    CLI Example:

        salt '*' iptables.new_chain filter CUSTOM_CHAIN

        IPv6:
        salt '*' iptables.new_chain filter CUSTOM_CHAIN family=ipv6
    

iptables.save:

    Save the current in-memory rules to disk

    CLI Example:

        salt '*' iptables.save /etc/sysconfig/iptables

        IPv6:
        salt '*' iptables.save /etc/sysconfig/iptables family=ipv6
    

iptables.set_policy:

    Set the current policy for the specified table/chain

    CLI Example:

        salt '*' iptables.set_policy filter INPUT ACCEPT

        IPv6:
        salt '*' iptables.set_policy filter INPUT ACCEPT family=ipv6
    

iptables.version:

    Return version from iptables --version

    CLI Example:

        salt '*' iptables.version

        IPv6:
        salt '*' iptables.version family=ipv6
    

key.finger:

    Return the minion's public key fingerprint

    CLI Example:

        salt '*' key.finger
    

keyboard.get_sys:

    Get current system keyboard setting

    CLI Example:

        salt '*' keyboard.get_sys
    

keyboard.get_x:

    Get current X keyboard setting

    CLI Example:

        salt '*' keyboard.get_x
    

keyboard.set_sys:

    Set current system keyboard setting

    CLI Example:

        salt '*' keyboard.set_sys dvorak
    

keyboard.set_x:

    Set current X keyboard setting

    CLI Example:

        salt '*' keyboard.set_x dvorak
    

kmod.available:

    Return a list of all available kernel modules

    CLI Example:

        salt '*' kmod.available
    

kmod.check_available:

    Check to see if the specified kernel module is available

    CLI Example:

        salt '*' kmod.check_available kvm
    

kmod.is_loaded:

    Check to see if the specified kernel module is loaded

    CLI Example:

        salt '*' kmod.is_loaded kvm
    

kmod.load:

    Load the specified kernel module

    mod
        Name of module to add

    persist
        Write module to /etc/modules to make it load on system reboot

    CLI Example:

        salt '*' kmod.load kvm
    

kmod.lsmod:

    Return a dict containing information about currently loaded modules

    CLI Example:

        salt '*' kmod.lsmod
    

kmod.mod_list:

    Return a list of the loaded module names

    CLI Example:

        salt '*' kmod.mod_list
    

kmod.remove:

    Remove the specified kernel module

    mod
        Name of module to remove

    persist
        Also remove module from /etc/modules

    comment
        If persist is set don't remove line from /etc/modules but only
        comment it

    CLI Example:

        salt '*' kmod.remove kvm
    

locale.get_locale:

    Get the current system locale

    CLI Example:

        salt '*' locale.get_locale
    

locale.list_avail:

    Lists available (compiled) locales

    CLI Example:

        salt '*' locale.list_avail
    

locale.set_locale:

    Sets the current system locale

    CLI Example:

        salt '*' locale.set_locale 'en_US.UTF-8'
    

locate.locate:

    Performs a file lookup. Valid options (and their defaults) are::

        basename=False
        count=False
        existing=False
        follow=True
        ignore=False
        nofollow=False
        wholename=True
        regex=False
        database=<locate's default database>
        limit=<integer, not set by default>

    See the manpage for ``locate(1)`` for further explanation of these options.

    CLI Example:

        salt '*' locate.locate
    

locate.stats:

    Returns statistics about the locate database

    CLI Example:

        salt '*' locate.stats
    

locate.updatedb:

    Updates the locate database

    CLI Example:

        salt '*' locate.updatedb
    

locate.version:

    Returns the version of locate

    CLI Example:

        salt '*' locate.version
    

logrotate.set:

    Set a new value for a specific configuration line

    CLI Example:

        salt '*' logrotate.set rotate 2

    Can also be used to set a single value inside a multiline configuration
    block. For instance, to change rotate in the following block::

        /var/log/wtmp {
            monthly
            create 0664 root root
            rotate 1
        }

    Use the following command:

        salt '*' logrotate.set /var/log/wtmp rotate 2

    This module also has the ability to scan files inside an include directory,
    and make changes in the appropriate file.
    

logrotate.show_conf:

    Show parsed configuration

    CLI Example:

        salt '*' logrotate.show_conf
    

lowpkg.file_dict:

    List the files that belong to a package, sorted by group. Not specifying
    any packages will return a list of _every_ file on the system's rpm
    database (not generally recommended).

    CLI Examples:

        salt '*' lowpkg.file_dict httpd
        salt '*' lowpkg.file_dict httpd postfix
        salt '*' lowpkg.file_dict
    

lowpkg.file_list:

    List the files that belong to a package. Not specifying any packages will
    return a list of _every_ file on the system's rpm database (not generally
    recommended).

    CLI Examples:

        salt '*' lowpkg.file_list httpd
        salt '*' lowpkg.file_list httpd postfix
        salt '*' lowpkg.file_list
    

lowpkg.list_pkgs:

    List the packages currently installed in a dict::

        {'<package_name>': '<version>'}

    CLI Example:

        salt '*' lowpkg.list_pkgs
    

lowpkg.verify:

    Runs an rpm -Va on a system, and returns the results in a dict

    CLI Example:

        salt '*' lowpkg.verify
    

lvm.fullversion:

    Return all version info from lvm version

    CLI Example:

        salt '*' lvm.fullversion
    

lvm.lvcreate:

    Create a new logical volume, with option for which physical volume to be used

    CLI Examples:

        salt '*' lvm.lvcreate new_volume_name vg_name size=10G
        salt '*' lvm.lvcreate new_volume_name vg_name extents=100 /dev/sdb
        salt '*' lvm.lvcreate new_snapshot    vg_name snapshot=volume_name size=3G
    

lvm.lvdisplay:

    Return information about the logical volume(s)

    CLI Examples:

        salt '*' lvm.lvdisplay
        salt '*' lvm.lvdisplay /dev/vg_myserver/root
    

lvm.lvremove:

    Remove a given existing logical volume from a named existing volume group

    CLI Example:

        salt '*' lvm.lvremove lvname vgname force=True
    

lvm.pvcreate:

    Set a physical device to be used as an LVM physical volume

    CLI Examples:

        salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2
        salt mymachine lvm.pvcreate /dev/sdb1 dataalignmentoffset=7s
    

lvm.pvdisplay:

    Return information about the physical volume(s)

    CLI Examples:

        salt '*' lvm.pvdisplay
        salt '*' lvm.pvdisplay /dev/md0
    

lvm.version:

    Return LVM version from lvm version

    CLI Example:

        salt '*' lvm.version
    

lvm.vgcreate:

    Create an LVM volume group

    CLI Examples:

        salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2
        salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y
    

lvm.vgdisplay:

    Return information about the volume group(s)

    CLI Examples:

        salt '*' lvm.vgdisplay
        salt '*' lvm.vgdisplay nova-volumes
    

lvm.vgremove:

    Remove an LVM volume group

    CLI Examples:

        salt mymachine lvm.vgremove vgname
        salt mymachine lvm.vgremove vgname force=True
    

match.compound:

    Return True if the minion matches the given compound target

    CLI Example:

        salt '*' match.compound 'L@cheese,foo and *'
    

match.data:

    Return True if the minion matches the given data target

    CLI Example:

        salt '*' match.data 'spam:eggs'
    

match.glob:

    Return True if the minion matches the given glob target

    CLI Example:

        salt '*' match.glob '*'
    

match.grain:

    Return True if the minion matches the given grain target. The ``delim``
    argument can be used to specify a different delimiter.

    CLI Example:

        salt '*' match.grain 'os:Ubuntu'
        salt '*' match.grain_pcre 'ipv6|2001:db8::ff00:42:8329' delim='|'

    Changed in version 0.16.4
        ``delim`` argument added
    

match.grain_pcre:

    Return True if the minion matches the given grain_pcre target. The
    ``delim`` argument can be used to specify a different delimiter.

    CLI Example:

        salt '*' match.grain_pcre 'os:Fedo.*'
        salt '*' match.grain_pcre 'ipv6|2001:.*' delim='|'

    Changed in version 0.16.4
        ``delim`` argument added
    

match.ipcidr:

    Return True if the minion matches the given ipcidr target

    CLI Example:

        salt '*' match.ipcidr '192.168.44.0/24'
    

match.list:

    Return True if the minion matches the given list target

    CLI Example:

        salt '*' match.list 'server1,server2'
    

match.pcre:

    Return True if the minion matches the given pcre target

    CLI Example:

        salt '*' match.pcre '.*'
    

match.pillar:

    Return True if the minion matches the given pillar target. The
    ``delim`` argument can be used to specify a different delimiter.

    CLI Example:

        salt '*' match.pillar 'cheese:foo'
        salt '*' match.pillar 'clone_url|https://github.com/saltstack/salt.git' delim='|'

    Changed in version 0.16.4
        ``delim`` argument added
    

mine.delete:

    Remove specific function contents of minion. Returns True on success.

    CLI Example:

        salt '*' mine.delete 'network.interfaces'
    

mine.flush:

    Remove all mine contents of minion. Returns True on success.

    CLI Example:

        salt '*' mine.flush
    

mine.get:

    Get data from the mine based on the target, function and expr_form

    Targets can be matched based on any standard matching system that can be
    matched on the master via these keywords::

        glob
        pcre
        grain
        grain_pcre

    CLI Example:

        salt '*' mine.get '*' network.interfaces
        salt '*' mine.get 'os:Fedora' network.interfaces grain
    

mine.send:

    Send a specific function to the mine.

    CLI Example:

        salt '*' mine.send network.interfaces eth0
    

mine.update:

    Execute the configured functions and send the data back up to the master
    The functions to be executed are merged from the master config, pillar and
    minion config under the option "function_cache":

        mine_functions:
          network.ip_addrs:
            - eth0
          disk.usage: []

    The function cache will be populated with information from executing these
    functions

    CLI Example:

        salt '*' mine.update
    

modjk.bulk_activate:

    Activate all the given workers in the specific load balancer

    CLI Examples:

        salt '*' modjk.bulk_activate node1,node2,node3 loadbalancer1
        salt '*' modjk.bulk_activate node1,node2,node3 loadbalancer1 other-profile

        salt '*' modjk.bulk_activate ["node1","node2","node3"] loadbalancer1
        salt '*' modjk.bulk_activate ["node1","node2","node3"] loadbalancer1 other-profile
    

modjk.bulk_disable:

    Disable all the given workers in the specific load balancer

    CLI Examples:

        salt '*' modjk.bulk_disable node1,node2,node3 loadbalancer1
        salt '*' modjk.bulk_disable node1,node2,node3 loadbalancer1 other-profile

        salt '*' modjk.bulk_disable ["node1","node2","node3"] loadbalancer1
        salt '*' modjk.bulk_disable ["node1","node2","node3"] loadbalancer1 other-profile
    

modjk.bulk_recover:

    Recover all the given workers in the specific load balancer

    CLI Examples:

        salt '*' modjk.bulk_recover node1,node2,node3 loadbalancer1
        salt '*' modjk.bulk_recover node1,node2,node3 loadbalancer1 other-profile

        salt '*' modjk.bulk_recover ["node1","node2","node3"] loadbalancer1
        salt '*' modjk.bulk_recover ["node1","node2","node3"] loadbalancer1 other-profile
    

modjk.bulk_stop:

    Stop all the given workers in the specific load balancer

    CLI Examples:

        salt '*' modjk.bulk_stop node1,node2,node3 loadbalancer1
        salt '*' modjk.bulk_stop node1,node2,node3 loadbalancer1 other-profile

        salt '*' modjk.bulk_stop ["node1","node2","node3"] loadbalancer1
        salt '*' modjk.bulk_stop ["node1","node2","node3"] loadbalancer1 other-profile
    

modjk.dump_config:

    Dump the original configuration that was loaded from disk

    CLI Examples:

        salt '*' modjk.dump_config
        salt '*' modjk.dump_config other-profile
    

modjk.get_running:

    Get the current running config (not from disk)

    CLI Examples:

        salt '*' modjk.get_running
        salt '*' modjk.get_running other-profile
    

modjk.lb_edit:

    Edit the loadbalancer settings

    Note: http://tomcat.apache.org/connectors-doc/reference/status.html
    Data Parameters for the standard Update Action

    CLI Examples:

        salt '*' modjk.lb_edit loadbalancer1 "{'vlr': 1, 'vlt': 60}"
        salt '*' modjk.lb_edit loadbalancer1 "{'vlr': 1, 'vlt': 60}" other-profile
    

modjk.list_configured_members:

    Return a list of member workers from the configuration files

    CLI Examples:

        salt '*' modjk.list_configured_members loadbalancer1
        salt '*' modjk.list_configured_members loadbalancer1 other-profile
    

modjk.recover_all:

    Set the all the workers in lbn to recover and activate them if they are not

    CLI Examples:

        salt '*' modjk.recover_all loadbalancer1
        salt '*' modjk.recover_all loadbalancer1 other-profile
    

modjk.reset_stats:

    Reset all runtime statistics for the load balancer

    CLI Examples:

        salt '*' modjk.reset_stats loadbalancer1
        salt '*' modjk.reset_stats loadbalancer1 other-profile
    

modjk.version:

    Return the modjk version

    CLI Examples:

        salt '*' modjk.version
        salt '*' modjk.version other-profile
    

modjk.worker_activate:

    Set the worker to activate state in the lbn load balancer

    CLI Examples:

        salt '*' modjk.worker_activate node1 loadbalancer1
        salt '*' modjk.worker_activate node1 loadbalancer1 other-profile
    

modjk.worker_disable:

    Set the worker to disable state in the lbn load balancer

    CLI Examples:

        salt '*' modjk.worker_disable node1 loadbalancer1
        salt '*' modjk.worker_disable node1 loadbalancer1 other-profile
    

modjk.worker_edit:

    Edit the worker settings

    Note: http://tomcat.apache.org/connectors-doc/reference/status.html
    Data Parameters for the standard Update Action

    CLI Examples:

        salt '*' modjk.worker_edit node1 loadbalancer1 "{'vwf': 500, 'vwd': 60}"
        salt '*' modjk.worker_edit node1 loadbalancer1 "{'vwf': 500, 'vwd': 60}" other-profile
    

modjk.worker_recover:

    Set the worker to recover
    this module will fail if it is in OK state

    CLI Examples:

        salt '*' modjk.worker_recover node1 loadbalancer1
        salt '*' modjk.worker_recover node1 loadbalancer1 other-profile
    

modjk.worker_status:

    Return the state of the worker

    CLI Examples:

        salt '*' modjk.worker_status node1
        salt '*' modjk.worker_status node1 other-profile
    

modjk.worker_stop:

    Set the worker to stopped state in the lbn load balancer

    CLI Examples:

        salt '*' modjk.worker_activate node1 loadbalancer1
        salt '*' modjk.worker_activate node1 loadbalancer1 other-profile
    

modjk.workers:

    Return a list of member workers and their status

    CLI Examples:

        salt '*' modjk.workers
        salt '*' modjk.workers other-profile
    

monit.monitor:

    monitor service via monit

    CLI Example:

        salt '*' monit.monitor <service name>
    

monit.restart:

    Restart service via monit

    CLI Example:

        salt '*' monit.restart <service name>
    

monit.start:


    CLI Example:

        salt '*' monit.start <service name>
    

monit.stop:

    Stops service via monit

    CLI Example:

        salt '*' monit.stop <service name>
    

monit.summary:

    Display a summary from monit

    CLI Example:

        salt '*' monit.summary
        salt '*' monit.summary <service name>
    

monit.unmonitor:

    Unmonitor service via monit

    CLI Example:

        salt '*' monit.unmonitor <service name>
    

mount.active:

    List the active mounts.

    CLI Example:

        salt '*' mount.active
    

mount.fstab:

    List the contents of the fstab

    CLI Example:

        salt '*' mount.fstab
    

mount.is_fuse_exec:

    Returns true if the command passed is a fuse mountable application.

    CLI Example:

        salt '*' mount.is_fuse_exec sshfs
    

mount.mount:

    Mount a device

    CLI Example:

        salt '*' mount.mount /mnt/foo /dev/sdz1 True
    

mount.remount:

    Attempt to remount a device, if the device is not already mounted, mount
    is called

    CLI Example:

        salt '*' mount.remount /mnt/foo /dev/sdz1 True
    

mount.rm_fstab:

    Remove the mount point from the fstab

    CLI Example:

        salt '*' mount.rm_fstab /mnt/foo
    

mount.set_fstab:

    Verify that this mount is represented in the fstab, change the mount
    to match the data passed, or add the mount if it is not present.

    CLI Example:

        salt '*' mount.set_fstab /mnt/foo /dev/sdz1 ext4
    

mount.swapoff:

    Deactivate a named swap mount

    CLI Example:

        salt '*' mount.swapoff /root/swapfile
    

mount.swapon:

    Activate a swap disk

    CLI Example:

        salt '*' mount.swapon /root/swapfile
    

mount.swaps:

    Return a dict containing information on active swap

    CLI Example:

        salt '*' mount.swaps
    

mount.umount:

    Attempt to unmount a device by specifying the directory it is mounted on

    CLI Example:

        salt '*' mount.umount /mnt/foo
    

network.active_tcp:

    Return a dict containing information on all of the running TCP connections

    CLI Example:

        salt '*' network.active_tcp
    

network.arp:

    Return the arp table from the minion

    CLI Example:

        salt '*' network.arp
    

network.dig:

    Performs a DNS lookup with dig

    CLI Example:

        salt '*' network.dig archlinux.org
    

network.get_hostname:

    Get hostname

    CLI Example:

        salt '*' network.get_hostname
    

network.hw_addr:

    Return the hardware address (a.k.a. MAC address) for a given interface

    CLI Example:

        salt '*' network.hw_addr eth0
    

network.hwaddr:

    Return the hardware address (a.k.a. MAC address) for a given interface

    CLI Example:

        salt '*' network.hw_addr eth0
    

network.in_subnet:

    Returns True if host is within specified subnet, otherwise False.

    CLI Example:

        salt '*' network.in_subnet 10.0.0.0/16
    

network.interfaces:

    Return a dictionary of information about all the interfaces on the minion

    CLI Example:

        salt '*' network.interfaces
    

network.ip_addrs:

    Returns a list of IPv4 addresses assigned to the host. 127.0.0.1 is
    ignored, unless 'include_loopback=True' is indicated. If 'interface' is
    provided, then only IP addresses from that interface will be returned.
    Providing a CIDR via 'cidr="10.0.0.0/8"' will return only the addresses
    which are within that subnet.

    CLI Example:

        salt '*' network.ip_addrs
    

network.ip_addrs6:

    Returns a list of IPv6 addresses assigned to the host. ::1 is ignored,
    unless 'include_loopback=True' is indicated. If 'interface' is provided,
    then only IP addresses from that interface will be returned.

    CLI Example:

        salt '*' network.ip_addrs6
    

network.ipaddrs:

    Returns a list of IPv4 addresses assigned to the host. 127.0.0.1 is
    ignored, unless 'include_loopback=True' is indicated. If 'interface' is
    provided, then only IP addresses from that interface will be returned.
    Providing a CIDR via 'cidr="10.0.0.0/8"' will return only the addresses
    which are within that subnet.

    CLI Example:

        salt '*' network.ip_addrs
    

network.ipaddrs6:

    Returns a list of IPv6 addresses assigned to the host. ::1 is ignored,
    unless 'include_loopback=True' is indicated. If 'interface' is provided,
    then only IP addresses from that interface will be returned.

    CLI Example:

        salt '*' network.ip_addrs6
    

network.mod_hostname:

    Modify hostname

    CLI Example:

        salt '*' network.mod_hostname   master.saltstack.com
    

network.netstat:

    Return information on open ports and states

    CLI Example:

        salt '*' network.netstat
    

network.ping:

    Performs a ping to a host

    CLI Example:

        salt '*' network.ping archlinux.org
    

network.subnets:

    Returns a list of subnets to which the host belongs

    CLI Example:

        salt '*' network.subnets
    

network.traceroute:

    Performs a traceroute to a 3rd party host

    CLI Example:

        salt '*' network.traceroute archlinux.org
    

nfs3.del_export:

    Remove an export

    CLI Example:

        salt '*' nfs.del_export /media/storage
    

nfs3.list_exports:

    List configured exports

    CLI Example:

        salt '*' nfs.list_exports
    

openstack_config.delete:

    Delete a value from an OpenStack configuration file.

    filename
        The full path to the configuration file

    section
        The section from which to delete the parameter

    parameter
        The parameter to delete

    CLI Example:

        salt-call openstack_config.delete /etc/keystone/keystone.conf sql connection
    

openstack_config.get:

    Get a value from an OpenStack configuration file.

    filename
        The full path to the configuration file

    section
        The section from which to search for the parameter

    parameter
        The parameter to return

    CLI Example:

        salt-call openstack_config.get /etc/keystone/keystone.conf sql connection

    

openstack_config.set:

    Set a value in an OpenStack configuration file.

    filename
        The full path to the configuration file

    section
        The section in which the parameter will be set

    parameter
        The parameter to change

    value
        The value to set

    CLI Example:

        salt-call openstack_config.set /etc/keystone/keystone.conf sql connection foo
    

pam.read_file:

    This is just a test function, to make sure parsing works

    CLI Example:

        salt '*' pam.read_file /etc/pam.d/login
    

partition.align_check:

    partition.align_check device part_type partition

    Check if partition satisfies the alignment constraint of part_type.
    Type must be "minimal" or "optimal".

    CLI Example:

        salt '*' partition.align_check /dev/sda minimal 1
    

partition.check:

    partition.check device minor

    Checks if the file system on partition <minor> has any errors.

    CLI Example:

        salt '*' partition.check 1
    

partition.cp:

    partition.check device from_minor to_minor

    Copies the file system on the partition <from-minor> to partition
        <to-minor>, deleting the original contents of the destination
        partition.

    CLI Example:

        salt '*' partition.cp /dev/sda 2 3
    

partition.get_id:

    partition.get_id

    Prints the system ID for the partition. Some typical values are::

         b: FAT32 (vfat)
         7: HPFS/NTFS
        82: Linux Swap
        83: Linux
        8e: Linux LVM
        fd: Linux RAID Auto

    CLI Example:

        salt '*' partition.get_id /dev/sda 1
    

partition.list:

    partition.list device unit

    Prints partition information of given <device>

    CLI Examples:

        salt '*' partition.list /dev/sda
        salt '*' partition.list /dev/sda unit=s
        salt '*' partition.list /dev/sda unit=kB
    

partition.mkfs:

    partition.mkfs device fs_type

    Makes a file system <fs_type> on partition <device>, destroying all data
        that resides on that partition. <fs_type> must be one of "ext2",
        "fat32", "fat16", "linux-swap" or "reiserfs" (if libreiserfs is
        installed)

    CLI Example:

        salt '*' partition.mkfs /dev/sda2 fat32
    

partition.mklabel:

    partition.mklabel device label_type

    Create a new disklabel (partition table) of label_type.
    Type should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac",
    "msdos", "pc98", or "sun".

    CLI Example:

        salt '*' partition.mklabel /dev/sda msdos
    

partition.mkpart:

    partition.mkpart device part_type fs_type start end

    Make a part_type partition for filesystem fs_type, beginning at start and
        ending at end (by default in megabytes).  part_type should be one of
        "primary", "logical", or "extended".

    CLI Example:

        salt '*' partition.mkpart /dev/sda primary fat32 0 639
    

partition.mkpartfs:

    partition.mkpartfs device part_type fs_type start end

    Make a <part_type> partition with a new filesystem of <fs_type>, beginning
        at <start> and ending at <end> (by default in megabytes).  <part_type>
        should be one of "primary", "logical", or "extended". <fs_type> must be
        one of "ext2", "fat32", "fat16", "linux-swap" or "reiserfs" (if
        libreiserfs is installed)

    CLI Example:

        salt '*' partition.mkpartfs /dev/sda logical ext2 440 670
    

partition.name:

    partition.name device partition name

    Set the name of partition to name. This option works only on Mac, PC98,
        and GPT disklabels. The name can be placed in quotes, if necessary.

    CLI Example:

        salt '*' partition.name /dev/sda 1 'My Documents'
    

partition.part_list:

    Deprecated. Calls partition.list.

    CLI Examples:

        salt '*' partition.part_list /dev/sda
        salt '*' partition.part_list /dev/sda unit=s
        salt '*' partition.part_list /dev/sda unit=kB
    

partition.probe:

    Ask the kernel to update its local partition data

    CLI Examples:

        salt '*' partition.probe
        salt '*' partition.probe /dev/sda
    

partition.rescue:

    partition.rescue device start end

    Rescue a lost partition that was located somewhere between start and end.
        If a partition is found, parted will ask if you want to create an
        entry for it in the partition table.

    CLI Example:

        salt '*' partition.rescue /dev/sda 0 8056
    

partition.resize:

    partition.resize device minor, start, end

    Resizes the partition with number <minor>. The partition will start <start>
        from the beginning of the disk, and end <end> from the beginning of the
        disk. resize never changes the minor number. Extended partitions can be
        resized, so long as the new extended partition completely contains all
        logical partitions.

    CLI Example:

        salt '*' partition.resize /dev/sda 3 200 850
    

partition.rm:

    partition.rm device minor

    Removes the partition with number <minor>.

    CLI Example:

        salt '*' partition.rm /dev/sda 5
    

partition.set:

    partition.set device  minor flag state

    Changes a flag on the partition with number <minor>. A flag can be either
        "on" or "off". Some or all of these flags will be available, depending
        on what disk label you are using.

    CLI Example:

        salt '*' partition.set /dev/sda 1 boot on
    

partition.set_id:

    partition.set_id

    Sets the system ID for the partition. Some typical values are::

         b: FAT32 (vfat)
         7: HPFS/NTFS
        82: Linux Swap
        83: Linux
        8e: Linux LVM
        fd: Linux RAID Auto

    CLI Example:

        salt '*' partition.set_id /dev/sda 1 83
    

partition.system_types:

    List the system types that are supported by the installed version of sfdisk

    CLI Example:

        salt '*' partition.system_types
    

partition.toggle:

    partition.toggle device partition flag

    Toggle the state of <flag> on <partition>

    CLI Example:

        salt '*' partition.name /dev/sda 1 boot
    

pillar.data:

    This function calls the master for a fresh pillar and generates the pillar
    data on the fly, unlike pillar.raw which returns the pillar data which
    is currently loaded into the minion.

    CLI Example:

        salt '*' pillar.items
    

pillar.ext:

    Generate the pillar and apply an explicit external pillar

    CLI Example:

        salt '*' pillar.ext 'libvirt: _'
    

pillar.get:

    New in version 0.14

    Attempt to retrieve the named value from pillar, if the named value is not
    available return the passed default. The default return is an empty string.

    The value can also represent a value in a nested dict using a ":" delimiter
    for the dict. This means that if a dict in pillar looks like this::

        {'pkg': {'apache': 'httpd'}}

    To retrieve the value associated with the apache key in the pkg dict this
    key can be passed::

        pkg:apache

    CLI Example:

        salt '*' pillar.get pkg:apache
    

pillar.item:

    New in version 0.16.2

    Return one ore more pillar entries

    CLI Examples:

        salt '*' pillar.item foo
        salt '*' pillar.item foo bar baz
    

pillar.items:

    This function calls the master for a fresh pillar and generates the pillar
    data on the fly, unlike pillar.raw which returns the pillar data which
    is currently loaded into the minion.

    CLI Example:

        salt '*' pillar.items
    

pillar.raw:

    Return the raw pillar data that is available in the module. This will
    show the pillar as it is loaded as the __pillar__ dict.

    CLI Example:

        salt '*' pillar.raw

    With the optional key argument, you can select a subtree of the
    pillar raw data.::

        salt '*' pillar.raw key='roles'
    

pip.freeze:

    Return a list of installed packages either globally or in the specified
    virtualenv

    bin_env
        path to pip bin or path to virtualenv. If doing an uninstall from
        the system python and want to use a specific pip bin (pip-2.7,
        pip-2.6, etc..) just specify the pip bin you want.
        If uninstalling from a virtualenv, just use the path to the virtualenv
        (/home/code/path/to/virtualenv/)
    user
        The user under which to run pip

    Note:
        The ``runas`` argument is deprecated as of 0.16.2. ``user`` should be
        used instead.

    cwd
        Current working directory to run pip from

    CLI Example:

        salt '*' pip.freeze /home/code/path/to/virtualenv/
    

pip.install:

    Install packages with pip

    Install packages individually or from a pip requirements file. Install
    packages globally or to a virtualenv.

    pkgs
        comma separated list of packages to install
    requirements
        path to requirements
    bin_env
        path to pip bin or path to virtualenv. If doing a system install,
        and want to use a specific pip bin (pip-2.7, pip-2.6, etc..) just
        specify the pip bin you want.
        If installing into a virtualenv, just use the path to the virtualenv
        (/home/code/path/to/virtualenv/)
    env
        deprecated, use bin_env now
    use_wheel
        Prefer wheel archives (requires pip>=1.4)
    log
        Log file where a complete (maximum verbosity) record will be kept
    proxy
        Specify a proxy in the form
        user:passwd@proxy.server:port. Note that the
        user:password@ is optional and required only if you
        are behind an authenticated proxy.  If you provide
        user@proxy.server:port then you will be prompted for a
        password.
    timeout
        Set the socket timeout (default 15 seconds)
    editable
        install something editable (i.e.
        git+https://github.com/worldcompany/djangoembed.git#egg=djangoembed)
    find_links
        URL to look for packages at
    index_url
        Base URL of Python Package Index
    extra_index_url
        Extra URLs of package indexes to use in addition to ``index_url``
    no_index
        Ignore package index
    mirrors
        Specific mirror URL(s) to query (automatically adds --use-mirrors)
    build
        Unpack packages into ``build`` dir
    target
        Install packages into ``target`` dir
    download
        Download packages into ``download`` instead of installing them
    download_cache
        Cache downloaded packages in ``download_cache`` dir
    source
        Check out ``editable`` packages into ``source`` dir
    upgrade
        Upgrade all packages to the newest available version
    force_reinstall
        When upgrading, reinstall all packages even if they are already
        up-to-date.
    ignore_installed
        Ignore the installed packages (reinstalling instead)
    exists_action
        Default action when a path already exists: (s)witch, (i)gnore, (w)wipe,
        (b)ackup
    no_deps
        Ignore package dependencies
    no_install
        Download and unpack all packages, but don't actually install them
    no_download
        Don't download any packages, just install the ones
        already downloaded (completes an install run with
        --no-install)
    install_options
        Extra arguments to be supplied to the setup.py install
        command (use like --install-option="--install-
        scripts=/usr/local/bin").  Use multiple --install-
        option options to pass multiple options to setup.py
        install.  If you are using an option with a directory
        path, be sure to use absolute path.
    global_options
        Extra global options to be supplied to the setup.py call before the
        install command.
    user
        The user under which to run pip

    Note:
        The ``runas`` argument is deprecated as of 0.16.2. ``user`` should be
        used instead.

    no_chown
        When user is given, do not attempt to copy and chown
        a requirements file
    cwd
        Current working directory to run pip from
    activate
        Activates the virtual environment, if given via bin_env,
        before running install.
    pre_releases
        Include pre-releases in the available versions


    CLI Example:

        salt '*' pip.install <package name>,<package2 name>
        salt '*' pip.install requirements=/path/to/requirements.txt
        salt '*' pip.install <package name> bin_env=/path/to/virtualenv
        salt '*' pip.install <package name> bin_env=/path/to/pip_bin

    Complicated CLI example::

        salt '*' pip.install markdown,django editable=git+https://github.com/worldcompany/djangoembed.git#egg=djangoembed upgrade=True no_deps=True

    

pip.list:

    Filter list of installed apps from ``freeze`` and check to see if
    ``prefix`` exists in the list of packages installed.

    CLI Example:

        salt '*' pip.list salt
    

pip.uninstall:

    Uninstall packages with pip

    Uninstall packages individually or from a pip requirements file. Uninstall
    packages globally or from a virtualenv.

    pkgs
        comma separated list of packages to install
    requirements
        path to requirements
    bin_env
        path to pip bin or path to virtualenv. If doing an uninstall from
        the system python and want to use a specific pip bin (pip-2.7,
        pip-2.6, etc..) just specify the pip bin you want.
        If uninstalling from a virtualenv, just use the path to the virtualenv
        (/home/code/path/to/virtualenv/)
    log
        Log file where a complete (maximum verbosity) record will be kept
    proxy
        Specify a proxy in the form
        user:passwd@proxy.server:port. Note that the
        user:password@ is optional and required only if you
        are behind an authenticated proxy.  If you provide
        user@proxy.server:port then you will be prompted for a
        password.
    timeout
        Set the socket timeout (default 15 seconds)
    user
        The user under which to run pip

    Note:
        The ``runas`` argument is deprecated as of 0.16.2. ``user`` should be
        used instead.

    no_chown
        When user is given, do not attempt to copy and chown
        a requirements file
    cwd
        Current working directory to run pip from

    CLI Example:

        salt '*' pip.uninstall <package name>,<package2 name>
        salt '*' pip.uninstall requirements=/path/to/requirements.txt
        salt '*' pip.uninstall <package name> bin_env=/path/to/virtualenv
        salt '*' pip.uninstall <package name> bin_env=/path/to/pip_bin

    

pip.version:

    New in version 0.17.0

    Returns the version of pip. Use ``bin_env`` to specify the path to a
    virtualenv and get the version of pip in that virtualenv.

    If unable to detect the pip version, returns ``None``.

    CLI Example:

        salt '*' pip.version
    

pkg.available_version:

    Return the latest version of the named package available for upgrade or
    installation. If more than one package name is specified, a dict of
    name/version pairs is returned.

    If the latest version of a given package is already installed, an empty
    string will be returned for that package.

    A specific repo can be requested using the ``fromrepo`` keyword argument.

    CLI Example:

        salt '*' pkg.latest_version <package name>
        salt '*' pkg.latest_version <package name> fromrepo=epel-testing
        salt '*' pkg.latest_version <package1> <package2> <package3> ...
    

pkg.check_db:

    New in version 0.17.0

    Returns a dict containing the following information for each specified
    package:

    1. A key ``found``, which will be a boolean value denoting if a match was
       found in the package database.
    2. If ``found`` is ``False``, then a second key called ``suggestions`` will
       be present, which will contain a list of possible matches.

    The ``fromrepo``, ``enablerepo``, and ``disablerepo`` arguments are
    supported, as used in pkg states.

    CLI Examples:

        salt '*' pkg.check_db <package1> <package2> <package3>
        salt '*' pkg.check_db <package1> <package2> <package3> fromrepo=epel-testing
    

pkg.clean_metadata:

    New in version 2014.1.0 (Hydrogen)

    Cleans local yum metadata. Functionally identical to :mod:`refresh_db()
    <salt.modules.yumpkg.refresh_db>`.

    CLI Example:

        salt '*' pkg.clean_metadata
    

pkg.del_repo:

    Delete a repo from <basedir> (default basedir: /etc/yum.repos.d).

    If the .repo file that the repo exists in does not contain any other repo
    configuration, the file itself will be deleted.

    CLI Examples:

        salt '*' pkg.del_repo myrepo
        salt '*' pkg.del_repo myrepo basedir=/path/to/dir
    

pkg.expand_repo_def:

    Take a repository definition and expand it to the full pkg repository dict
    that can be used for comparison. This is a helper function to make
    certain repo managers sane for comparison in the pkgrepo states.

    There is no use to calling this function via the CLI.
    

pkg.file_dict:

    New in version 2014.1.0 (Hydrogen)

    List the files that belong to a package, grouped by package. Not
    specifying any packages will return a list of _every_ file on the system's
    rpm database (not generally recommended).

    CLI Examples:

        salt '*' pkg.file_list httpd
        salt '*' pkg.file_list httpd postfix
        salt '*' pkg.file_list
    

pkg.file_list:

    New in version 2014.1.0 (Hydrogen)

    List the files that belong to a package. Not specifying any packages will
    return a list of _every_ file on the system's rpm database (not generally
    recommended).

    CLI Examples:

        salt '*' pkg.file_list httpd
        salt '*' pkg.file_list httpd postfix
        salt '*' pkg.file_list
    

pkg.get_repo:

    Display a repo from <basedir> (default basedir: /etc/yum.repos.d).

    CLI Examples:

        salt '*' pkg.get_repo myrepo
        salt '*' pkg.get_repo myrepo basedir=/path/to/dir
    

pkg.group_diff:

    New in version 2014.1.0 (Hydrogen)

    Lists packages belonging to a certain group, and which are installed

    CLI Example:

        salt '*' pkg.group_diff 'Perl Support'
    

pkg.group_info:

    New in version 2014.1.0 (Hydrogen)

    Lists packages belonging to a certain group

    CLI Example:

        salt '*' pkg.group_info 'Perl Support'
    

pkg.group_install:

    New in version 2014.1.0 (Hydrogen)

    Install the passed package group(s). This is basically a wrapper around
    pkg.install, which performs package group resolution for the user. This
    function is currently considered experimental, and should be expected to
    undergo changes.

    name
        Package group to install. To install more than one group, either use a
        comma-separated list or pass the value as a python list.

        CLI Examples:

            salt '*' pkg.group_install 'Group 1'
            salt '*' pkg.group_install 'Group 1,Group 2'
            salt '*' pkg.group_install '["Group 1", "Group 2"]'

    skip
        The name(s), in a list, of any packages that would normally be
        installed by the package group ("default" packages), which should not
        be installed. Can be passed either as a comma-separated list or a
        python list.

        CLI Examples:

            salt '*' pkg.group_install 'My Group' skip='foo,bar'
            salt '*' pkg.group_install 'My Group' skip='["foo", "bar"]'

    include
        The name(s), in a list, of any packages which are included in a group,
        which would not normally be installed ("optional" packages). Note that
        this will not enforce group membership; if you include packages which
        are not members of the specified groups, they will still be installed.
        Can be passed either as a comma-separated list or a python list.

        CLI Examples:

            salt '*' pkg.group_install 'My Group' include='foo,bar'
            salt '*' pkg.group_install 'My Group' include='["foo", "bar"]'

    Note:

        Because this is essentially a wrapper around pkg.install, any argument
        which can be passed to pkg.install may also be included here, and it
        will be passed along wholesale.
    

pkg.group_list:

    New in version 2014.1.0 (Hydrogen)

    Lists all groups known by yum on this system

    CLI Example:

        salt '*' pkg.group_list
    

pkg.install:

    Install the passed package(s), add refresh=True to clean the yum database
    before package is installed.

    name
        The name of the package to be installed. Note that this parameter is
        ignored if either "pkgs" or "sources" is passed. Additionally, please
        note that this option can only be used to install packages from a
        software repository. To install a package file manually, use the
        "sources" option.

        32-bit packages can be installed on 64-bit systems by appending the
        architecture designation (``.i686``, ``.i586``, etc.) to the end of the
        package name.

        CLI Example:

            salt '*' pkg.install <package name>

    refresh
        Whether or not to update the yum database before executing.

    skip_verify
        Skip the GPG verification check (e.g., ``--nogpgcheck``)

    version
        Install a specific version of the package, e.g. 1.2.3-4.el5. Ignored
        if "pkgs" or "sources" is passed.


    Repository Options:

    fromrepo
        Specify a package repository (or repositories) from which to install.
        (e.g., ``yum --disablerepo='*' --enablerepo='somerepo'``)

    enablerepo (ignored if ``fromrepo`` is specified)
        Specify a disabled package repository (or repositories) to enable.
        (e.g., ``yum --enablerepo='somerepo'``)

    disablerepo (ignored if ``fromrepo`` is specified)
        Specify an enabled package repository (or repositories) to disable.
        (e.g., ``yum --disablerepo='somerepo'``)


    Multiple Package Installation Options:

    pkgs
        A list of packages to install from a software repository. Must be
        passed as a python list. A specific version number can be specified
        by using a single-element dict representing the package and its
        version.

        CLI Examples:

            salt '*' pkg.install pkgs='["foo", "bar"]'
            salt '*' pkg.install pkgs='["foo", {"bar": "1.2.3-4.el5"}]'

    sources
        A list of RPM packages to install. Must be passed as a list of dicts,
        with the keys being package names, and the values being the source URI
        or local path to the package.

        CLI Example:

            salt '*' pkg.install sources='[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'


    Returns a dict containing the new package names and versions::

        {'<package>': {'old': '<old-version>',
                       'new': '<new-version>'}}
    

pkg.latest_version:

    Return the latest version of the named package available for upgrade or
    installation. If more than one package name is specified, a dict of
    name/version pairs is returned.

    If the latest version of a given package is already installed, an empty
    string will be returned for that package.

    A specific repo can be requested using the ``fromrepo`` keyword argument.

    CLI Example:

        salt '*' pkg.latest_version <package name>
        salt '*' pkg.latest_version <package name> fromrepo=epel-testing
        salt '*' pkg.latest_version <package1> <package2> <package3> ...
    

pkg.list_pkgs:

    List the packages currently installed in a dict::

        {'<package_name>': '<version>'}

    CLI Example:

        salt '*' pkg.list_pkgs
    

pkg.list_repo_pkgs:

    New in version 2014.1.0 (Hydrogen)

    Returns all available packages. Optionally, package names can be passed and
    the results will be filtered to packages matching those names. This can be
    helpful in discovering the version or repo to specify in a pkg.installed
    state. The return data is a dictionary of repo names, with each repo having
    a list of dictionaries denoting the package name and version. An example of
    the return data would look like this:

        {
            '<repo_name>': [
                {'<package1>': '<version1>'},
                {'<package2>': '<version2>'},
                {'<package3>': '<version3>'}
            ]
        }

    fromrepo : None
        Only include results from the specified repo(s). Multiple repos can be
        specified, comma-separated.

    CLI Example:

        salt '*' pkg.list_repo_pkgs
        salt '*' pkg.list_repo_pkgs foo bar baz
        salt '*' pkg.list_repo_pkgs 'samba4*' fromrepo=base,updates
    

pkg.list_repos:

    Lists all repos in <basedir> (default: /etc/yum.repos.d/).

    CLI Example:

        salt '*' pkg.list_repos
    

pkg.list_upgrades:

    Check whether or not an upgrade is available for all packages

    CLI Example:

        salt '*' pkg.list_upgrades
    

pkg.mod_repo:

    Modify one or more values for a repo. If the repo does not exist, it will
    be created, so long as the following values are specified:

    repo
        name by which the yum refers to the repo
    name
        a human-readable name for the repo
    baseurl
        the URL for yum to reference
    mirrorlist
        the URL for yum to reference

    Key/Value pairs may also be removed from a repo's configuration by setting
    a key to a blank value. Bear in mind that a name cannot be deleted, and a
    baseurl can only be deleted if a mirrorlist is specified (or vice versa).

    CLI Examples:

        salt '*' pkg.mod_repo reponame enabled=1 gpgcheck=1
        salt '*' pkg.mod_repo reponame basedir=/path/to/dir enabled=1
        salt '*' pkg.mod_repo reponame baseurl= mirrorlist=http://host.com/
    

pkg.normalize_name:

    Strips the architecture from the specified package name, if necessary.
    Circomstances where this would be done include:

    * If the arch is 32 bit and the package name ends in a 32-bit arch.
    * If the arch matches the OS arch, or is ``noarch``.

    CLI Example:

        salt '*' pkg.normalize_name zsh.x86_64
    

pkg.purge:

    Package purges are not supported by yum, this function is identical to
    :mod:`pkg.remove <salt.modules.yumpkg.remove>`.

    name
        The name of the package to be deleted.


    Multiple Package Options:

    pkgs
        A list of packages to delete. Must be passed as a python list. The
        ``name`` parameter will be ignored if this option is passed.

    New in version 0.16.0


    Returns a dict containing the changes.

    CLI Example:

        salt '*' pkg.purge <package name>
        salt '*' pkg.purge <package1>,<package2>,<package3>
        salt '*' pkg.purge pkgs='["foo", "bar"]'
    

pkg.refresh_db:

    Check the yum repos for updated packages

    Returns:

    - ``True``: Updates are available
    - ``False``: An error occured
    - ``None``: No updates are available

    CLI Example:

        salt '*' pkg.refresh_db
    

pkg.remove:

    Remove packages with ``yum -q -y remove``.

    name
        The name of the package to be deleted.


    Multiple Package Options:

    pkgs
        A list of packages to delete. Must be passed as a python list. The
        ``name`` parameter will be ignored if this option is passed.

    New in version 0.16.0


    Returns a dict containing the changes.

    CLI Example:

        salt '*' pkg.remove <package name>
        salt '*' pkg.remove <package1>,<package2>,<package3>
        salt '*' pkg.remove pkgs='["foo", "bar"]'
    

pkg.upgrade:

    Run a full system upgrade, a yum upgrade

    Return a dict containing the new package names and versions::

        {'<package>': {'old': '<old-version>',
                       'new': '<new-version>'}}

    CLI Example:

        salt '*' pkg.upgrade
    

pkg.upgrade_available:

    Check whether or not an upgrade is available for a given package

    CLI Example:

        salt '*' pkg.upgrade_available <package name>
    

pkg.verify:

    New in version 2014.1.0 (Hydrogen)

    Runs an rpm -Va on a system, and returns the results in a dict

    CLI Example:

        salt '*' pkg.verify
    

pkg.version:

    Returns a string representing the package version or an empty string if not
    installed. If more than one package name is specified, a dict of
    name/version pairs is returned.

    CLI Example:

        salt '*' pkg.version <package name>
        salt '*' pkg.version <package1> <package2> <package3> ...
    

pkg_resource.add_pkg:

    Add a package to a dict of installed packages.

    CLI Example:

        salt '*' pkg_resource.add_pkg '{}' bind 9
    

pkg_resource.check_extra_requirements:

    Check if the installed package already has the given requirements.
    This function will simply try to call "pkg.check_extra_requirements".

    CLI Example:

        salt '*' pkg_resource.check_extra_requirements <pkgname> <extra_requirements>
    

pkg_resource.pack_sources:

    Accepts list of dicts (or a string representing a list of dicts) and packs
    the key/value pairs into a single dict.

    ``'[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'`` would become
    ``{"foo": "salt://foo.rpm", "bar": "salt://bar.rpm"}``

    CLI Example:

        salt '*' pkg_resource.pack_sources '[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'
    

pkg_resource.parse_targets:

    Parses the input to pkg.install and returns back the package(s) to be
    installed. Returns a list of packages, as well as a string noting whether
    the packages are to come from a repository or a binary package.

    CLI Example:

        salt '*' pkg_resource.parse_targets
    

pkg_resource.sort_pkglist:

    Accepts a dict obtained from pkg.list_pkgs() and sorts in place the list of
    versions for any packages that have multiple versions installed, so that
    two package lists can be compared to one another.

    CLI Example:

        salt '*' pkg_resource.sort_pkglist '["3.45", "2.13"]'
    

pkg_resource.stringify:

    Takes a dict of package name/version information and joins each list of
    installed versions into a string.

    CLI Example:

        salt '*' pkg_resource.stringify 'vim: 7.127'
    

pkg_resource.version:

    Common interface for obtaining the version of installed packages.

    CLI Example:

        salt '*' pkg_resource.version vim
        salt '*' pkg_resource.version foo bar baz
        salt '*' pkg_resource.version 'python*'
    

pkg_resource.version_clean:

    Clean the version string removing extra data.
    This function will simply try to call ``pkg.version_clean``.

    CLI Example:

        salt '*' pkg_resource.version_clean <version_string>
    

ps.boot_time:

    Return the boot time in number of seconds since the epoch began.

    CLI Example:

    time_format
        Optionally specify a `strftime`_ format string. Use
        ``time_format='%c'`` to get a nicely-formatted locale specific date and
        time (i.e. ``Fri May  2 19:08:32 2014``).

        .. _strftime: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior

        New in version 2014.1.4

        salt '*' ps.boot_time
    

ps.cached_physical_memory:

    Return the amount cached memory.

    CLI Example:

        salt '*' ps.cached_physical_memory
    

ps.cpu_percent:

    Return the percent of time the CPU is busy.

    interval
        the number of seconds to sample CPU usage over
    per_cpu
        if True return an array of CPU percent busy for each CPU, otherwise
        aggregate all percents into one number

    CLI Example:

        salt '*' ps.cpu_percent
    

ps.cpu_times:

    Return the percent of time the CPU spends in each state,
    e.g. user, system, idle, nice, iowait, irq, softirq.

    per_cpu
        if True return an array of percents for each CPU, otherwise aggregate
        all percents into one number

    CLI Example:

        salt '*' ps.cpu_times
    

ps.disk_io_counters:

    Return disk I/O statisitics.

    CLI Example:

        salt '*' ps.disk_io_counters
    

ps.disk_partition_usage:

    Return a list of disk partitions plus the mount point, filesystem and usage
    statistics.

    CLI Example:

        salt '*' ps.disk_partition_usage
    

ps.disk_partitions:

    Return a list of disk partitions and their device, mount point, and
    filesystem type.

    all
        if set to False, only return local, physical partitions (hard disk,
        USB, CD/DVD partitions).  If True, return all filesystems.

    CLI Example:

        salt '*' ps.disk_partitions
    

ps.disk_usage:

    Given a path, return a dict listing the total available space as well as
    the free space, and used space.

    CLI Example:

        salt '*' ps.disk_usage /home
    

ps.get_pid_list:

    Return a list of process ids (PIDs) for all running processes.

    CLI Example:

        salt '*' ps.get_pid_list
    

ps.get_users:

    Return logged-in users.

    CLI Example:

        salt '*' ps.get_users
    

ps.kill_pid:

    Kill a proccess by PID.

        salt 'minion' ps.kill_pid pid [signal=signal_number]

    pid
        PID of process to kill.

    signal
        Signal to send to the process. See manpage entry for kill
        for possible values. Default: 15 (SIGTERM).

    **Example:**

    Send SIGKILL to process with PID 2000:

        salt 'minion' ps.kill_pid 2000 signal=9
    

ps.network_io_counters:

    Return network I/O statisitics.

    CLI Example:

        salt '*' ps.network_io_counters
    

ps.num_cpus:

    Return the number of CPUs.

    CLI Example:

        salt '*' ps.num_cpus
    

ps.pgrep:

    Return the pids for processes matching a pattern.

    If full is true, the full command line is searched for a match,
    otherwise only the name of the command is searched.

        salt '*' ps.pgrep pattern [user=username] [full=(true|false)]

    pattern
        Pattern to search for in the process list.

    user
        Limit matches to the given username. Default: All users.

    full
        A boolean value indicating whether only the name of the command or
        the full command line should be matched against the pattern.

    **Examples:**

    Find all httpd processes on all 'www' minions:

        salt 'www.*' ps.pgrep httpd

    Find all bash processes owned by user 'tom':

        salt '*' ps.pgrep bash user=tom
    

ps.physical_memory_buffers:

    Return the amount of physical memory buffers.

    CLI Example:

        salt '*' ps.physical_memory_buffers
    

ps.physical_memory_usage:

    Return a dict that describes free and available physical memory.

    CLI Examples:

        salt '*' ps.physical_memory_usage
    

ps.pkill:

    Kill processes matching a pattern.

        salt '*' ps.pkill pattern [user=username] [signal=signal_number] \
                [full=(true|false)]

    pattern
        Pattern to search for in the process list.

    user
        Limit matches to the given username. Default: All users.

    signal
        Signal to send to the process(es). See manpage entry for kill
        for possible values. Default: 15 (SIGTERM).

    full
        A boolean value indicating whether only the name of the command or
        the full command line should be matched against the pattern.

    **Examples:**

    Send SIGHUP to all httpd processes on all 'www' minions:

        salt 'www.*' ps.pkill httpd signal=1

    Send SIGKILL to all bash processes owned by user 'tom':

        salt '*' ps.pkill bash signal=9 user=tom
    

ps.top:

    Return a list of top CPU consuming processes during the interval.
    num_processes = return the top N CPU consuming processes
    interval = the number of seconds to sample CPU usage over

    CLI Examples:

        salt '*' ps.top

        salt '*' ps.top 5 10
    

ps.total_physical_memory:

    Return the total number of bytes of physical memory.

    CLI Example:

        salt '*' ps.total_physical_memory
    

ps.virtual_memory_usage:

    Return a dict that describes free and available memory, both physical
    and virtual.

    CLI Example:

        salt '*' ps.virtual_memory_usage
    

publish.full_data:

    Return the full data about the publication, this is invoked in the same
    way as the publish function

    CLI Example:

        salt system.example.com publish.full_data '*' cmd.run 'ls -la /tmp'

    .. admonition:: Attention

        If you need to pass a value to a function argument and that value
        contains an equal sign, you **must** include the argument name.
        For example:

            salt '*' publish.full_data test.kwarg arg='cheese=spam'

    

publish.publish:

    Publish a command from the minion out to other minions.

    Publications need to be enabled on the Salt master and the minion
    needs to have permission to publish the command. The Salt master
    will also prevent a recursive publication loop, this means that a
    minion cannot command another minion to command another minion as
    that would create an infinite command loop.

    The expr_form argument is used to pass a target other than a glob into
    the execution, the available options are:

    - glob
    - pcre
    - grain
    - grain_pcre
    - pillar
    - ipcidr
    - range
    - compound

    The arguments sent to the minion publish function are separated with
    commas. This means that for a minion executing a command with multiple
    args it will look like this:

        salt system.example.com publish.publish '*' user.add 'foo,1020,1020'
        salt system.example.com publish.publish 'os:Fedora' network.interfaces '' grain

    CLI Example:

        salt system.example.com publish.publish '*' cmd.run 'ls -la /tmp'


    .. admonition:: Attention

        If you need to pass a value to a function argument and that value
        contains an equal sign, you **must** include the argument name.
        For example:

            salt '*' publish.publish test.kwarg arg='cheese=spam'


    

publish.runner:

    Execute a runner on the master and return the data from the runner
    function

    CLI Example:

        salt publish.runner manage.down
    

puppet.fact:

    Run facter for a specific fact

    CLI Example:

        salt '*' puppet.fact kernel
    

puppet.facts:

    Run facter and return the results

    CLI Example:

        salt '*' puppet.facts
    

puppet.noop:

    Execute a puppet noop run and return a dict with the stderr, stdout,
    return code, etc. Usage is the same as for puppet.run.

    CLI Example:

        salt '*' puppet.noop
        salt '*' puppet.noop tags=basefiles::edit,apache::server
        salt '*' puppet.noop debug
        salt '*' puppet.noop apply /a/b/manifest.pp modulepath=/a/b/modules tags=basefiles::edit,apache::server
    

puppet.run:

    Execute a puppet run and return a dict with the stderr, stdout,
    return code, etc. The first positional argument given is checked as a
    subcommand. Following positional arguments should be ordered with arguments
    required by the subcommand first, followed by non-keyvalue pair options.
    Tags are specified by a tag keyword and comma separated list of values. --
    http://projects.puppetlabs.com/projects/1/wiki/Using_Tags

    CLI Examples:

        salt '*' puppet.run
        salt '*' puppet.run tags=basefiles::edit,apache::server
        salt '*' puppet.run agent onetime no-daemonize no-usecacheonfailure no-splay ignorecache
        salt '*' puppet.run debug
        salt '*' puppet.run apply /a/b/manifest.pp modulepath=/a/b/modules tags=basefiles::edit,apache::server
    

quota.get_mode:

    Report whether the quota system for this device is on or off

    CLI Example:

        salt '*' quota.get_mode
    

quota.off:

    Turns off the quota system

    CLI Example:

        salt '*' quota.off
    

quota.on:

    Turns on the quota system

    CLI Example:

        salt '*' quota.on
    

quota.report:

    Report on quotas for a specific volume

    CLI Example:

        salt '*' quota.report /media/data
    

quota.set:

    Calls out to setquota, for a specific user or group

    CLI Example:

        salt '*' quota.set /media/data user=larry block-soft-limit=1048576
        salt '*' quota.set /media/data group=painters file-hard-limit=1000
    

quota.stats:

    Runs the quotastats command, and returns the parsed output

    CLI Example:

        salt '*' quota.stats
    

quota.warn:

    Runs the warnquota command, to send warning emails to users who
    are over their quota limit.

    CLI Example:

        salt '*' quota.warn
    

raid.create:

    Create a RAID device.

    Warning:
        Use with CAUTION, as this function can be very destructive if not used
        properly!

    Use this module just as a regular mdadm command.

    For more info, read the ``mdadm(8)`` manpage

    NOTE: It takes time to create a RAID array. You can check the progress in
    "resync_status:" field of the results from the following command:

        salt '*' raid.detail /dev/md0

    CLI Examples:

        salt '*' raid.create /dev/md0 level=1 chunk=256 raid-devices=2 /dev/xvdd /dev/xvde test_mode=True

    Note: Test mode

        Adding ``test_mode=True`` as an argument will print out the mdadm
        command that would have been run.

    :param args: The arguments u pass to this function.
    :param arguments:
        arguments['new_array']: The name of the new RAID array that will be created.
        arguments['opt_val']: Option with Value. Example: raid-devices=2
        arguments['opt_raw']: Option without Value. Example: force
        arguments['disks_to_array']: The disks that will be added to the new raid.
    :return:
        test_mode=True:
            Prints out the full command.
        test_mode=False (Default):
            Executes command on remote the host(s) and
            Prints out the mdadm output.
    

raid.destroy:

    Destroy a RAID device.

    WARNING This will zero the superblock of all members of the RAID array..

    CLI Example:

        salt '*' raid.destroy /dev/md0
    

raid.detail:

    Show detail for a specified RAID device

    CLI Example:

        salt '*' raid.detail '/dev/md0'
    

raid.list:

    List the RAID devices.

    CLI Example:

        salt '*' raid.list
    

rbenv.default:

    Returns or sets the currently defined default ruby.

    ruby=None
        The version to set as the default. Should match one of the versions
        listed by :mod:`rbenv.versions <salt.modules.rbenv.versions>`. Leave
        blank to return the current default.

    CLI Example:

        salt '*' rbenv.default
        salt '*' rbenv.default 2.0.0-p0
    

rbenv.do:

    Execute a ruby command with rbenv's shims from the user or the system.

    CLI Example:

        salt '*' rbenv.do 'gem list bundler'
        salt '*' rbenv.do 'gem list bundler' deploy
    

rbenv.do_with_ruby:

    Execute a ruby command with rbenv's shims using a specific ruby version.

    CLI Example:

        salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler'
        salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' deploy
    

rbenv.install:

    Install Rbenv systemwide

    CLI Example:

        salt '*' rbenv.install
    

rbenv.install_ruby:

    Install a ruby implementation.

    ruby
        The version of Ruby to install, should match one of the
        versions listed by rbenv.list

    CLI Example:

        salt '*' rbenv.install_ruby 2.0.0-p0
    

rbenv.is_installed:

    Check if Rbenv is installed.

    CLI Example:

        salt '*' rbenv.is_installed
    

rbenv.list:

    List the installable versions of ruby.

    CLI Example:

        salt '*' rbenv.list
    

rbenv.rehash:

    Run rbenv rehash to update the installed shims.

    CLI Example:

        salt '*' rbenv.rehash
    

rbenv.uninstall_ruby:

    Uninstall a ruby implementation.

    ruby
        The version of ruby to uninstall. Should match one of the versions
        listed by :mod:`rbenv.versions <salt.modules.rbenv.versions>`

    CLI Example:

        salt '*' rbenv.uninstall_ruby 2.0.0-p0
    

rbenv.update:

    Updates the current versions of Rbenv and Ruby-Build

    CLI Example:

        salt '*' rbenv.update
    

rbenv.versions:

    List the installed versions of ruby.

    CLI Example:

        salt '*' rbenv.versions
    

ret.get_fun:

    Return info about last time fun was called on each minion

    CLI Example:

        salt '*' ret.get_fun mysql network.interfaces
    

ret.get_jid:

    Return the information for a specified job id

    CLI Example:

        salt '*' ret.get_jid redis 20421104181954700505
    

ret.get_jids:

    Return a list of all job ids

    CLI Example:

        salt '*' ret.get_jids mysql
    

ret.get_minions:

    Return a list of all minions

    CLI Example:

        salt '*' ret.get_minions mysql
    

rsync.config:

    Return rsync config

    CLI Example:

        salt '*' rsync.config
    

rsync.rsync:

    Rsync files from src to dst

    CLI Example:

        salt '*' rsync.rsync {src} {dst} {delete=True} {update=True} {passwordfile=/etc/pass.crt} {exclude=xx}
        salt '*' rsync.rsync {src} {dst} {delete=True} {excludefrom=/xx.ini}
    

rsync.version:

    Return rsync version

    CLI Example:

        salt '*' rsync.version
    

rvm.do:

    Execute a command in an RVM controlled environment.

    ruby:
        The ruby to use.
    command:
        The command to execute.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.do 2.0.0 <command>
    

rvm.gemset_copy:

    Copy all gems from one gemset to another.

    source
        The name of the gemset to copy, complete with ruby version.
    destination
        The destination gemset.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.gemset_copy foobar bazquo
    

rvm.gemset_create:

    Creates a gemset.

    ruby
        The ruby version to create the gemset for.
    gemset
        The name of the gemset to create.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.gemset_create 2.0.0 foobar
    

rvm.gemset_delete:

    Deletes a gemset.

    ruby
        The ruby version the gemset belongs to.
    gemset
        The gemset to delete.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.gemset_delete 2.0.0 foobar
    

rvm.gemset_empty:

    Remove all gems from a gemset.

    ruby
        The ruby version the gemset belongs to.
    gemset
        The gemset to empty.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.gemset_empty 2.0.0 foobar
    

rvm.gemset_list:

    List all gemsets for the given ruby.

    ruby : default
        The ruby version to list the gemsets for
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.gemset_list
    

rvm.gemset_list_all:

    List all gemsets for all installed rubies.

    Note that you must have set a default ruby before this can work.

    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.gemset_list_all
    

rvm.get:

    Update RVM.

    version : stable
        Which version of RVM to install, e.g. stable or head.
    ruby
        The version of ruby to reinstall.

    CLI Example:

        salt '*' rvm.get
    

rvm.install:

    Install RVM system wide.

    CLI Example:

        salt '*' rvm.install
    

rvm.install_ruby:

    Install a ruby implementation.

    ruby
        The version of ruby to install.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.install_ruby 1.9.3-p385
    

rvm.is_installed:

    Check if RVM is installed.

    CLI Example:

        salt '*' rvm.is_installed
    

rvm.list:

    List all rvm installed rubies.

    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.list
    

rvm.reinstall_ruby:

    Reinstall a ruby implementation.

    ruby
        The version of ruby to reinstall.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.reinstall_ruby 1.9.3-p385
    

rvm.rubygems:

    Installs a specific rubygems version in the given ruby.

    ruby
        The ruby to install rubygems for.
    version
        The version of rubygems to install or 'remove' to use the version that
        ships with 1.9
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.rubygems 2.0.0 1.8.24
    

rvm.set_default:

    Set the default ruby.

    ruby
        The version of ruby to make the default.
    runas : None
        The user to run rvm as.

    CLI Example:

        salt '*' rvm.set_default 2.0.0
    

rvm.wrapper:

    Install RVM wrapper scripts.

    ruby_string
        Ruby/gemset to install wrappers for.
    wrapper_prefix
        What to prepend to the name of the generated wrapper binaries.
    runas : None
        The user to run rvm as.
    binaries : None
        The names of the binaries to create wrappers for. When nothing is
        given, wrappers for ruby, gem, rake, irb, rdoc, ri and testrb are
        generated.

    CLI Example:

        salt '*' rvm.wrapper <ruby_string> <wrapper_prefix>
    

s3.delete:

    Delete a bucket, or delete an object from a bucket.

    CLI Example to delete a bucket::

        salt myminion s3.delete mybucket

    CLI Example to delete an object from a bucket::

        salt myminion s3.delete mybucket remoteobject
    

s3.get:

    List the contents of a bucket, or return an object from a bucket. Set
    return_bin to True in order to retrieve an object wholesale. Otherwise,
    Salt will attempt to parse an XML response.

    CLI Example to list buckets:

        salt myminion s3.get

    CLI Example to list the contents of a bucket:

        salt myminion s3.get mybucket

    CLI Example to return the binary contents of an object:

        salt myminion s3.get mybucket myfile.png return_bin=True

    CLI Example to save the binary contents of an object to a local file:

        salt myminion s3.get mybucket myfile.png local_file=/tmp/myfile.png

    It is also possible to perform an action on a bucket. Currently, S3
    supports the following actions::

        acl
        cors
        lifecycle
        policy
        location
        logging
        notification
        tagging
        versions
        requestPayment
        versioning
        website

    To perform an action on a bucket:

        salt myminion s3.get mybucket myfile.png action=acl
    

s3.head:

    Return the metadata for a bucket, or an object in a bucket.

    CLI Examples:

        salt myminion s3.head mybucket
        salt myminion s3.head mybucket myfile.png
    

s3.put:

    Create a new bucket, or upload an object to a bucket.

    CLI Example to create a bucket:

        salt myminion s3.put mybucket

    CLI Example to upload an object to a bucket:

        salt myminion s3.put mybucket remotepath local_path=/path/to/file
    

saltutil.cmd:

    Assuming this minion is a master, execute a salt command

    CLI Example:

        salt '*' saltutil.cmd
    

saltutil.cmd_iter:

    Assuming this minion is a master, execute a salt command

    CLI Example:

        salt '*' saltutil.cmd
    

saltutil.find_job:

    Return the data for a specific job id

    CLI Example:

        salt '*' saltutil.find_job <job id>
    

saltutil.is_running:

    If the named function is running return the data associated with it/them.
    The argument can be a glob

    CLI Example:

        salt '*' saltutil.is_running state.highstate
    

saltutil.kill_job:

    Sends a kill signal (SIGKILL 9) to the named salt job's process

    CLI Example:

        salt '*' saltutil.kill_job <job id>
    

saltutil.refresh_modules:

    Signal the minion to refresh the module and grain data

    CLI Example:

        salt '*' saltutil.refresh_modules
    

saltutil.refresh_pillar:

    Signal the minion to refresh the pillar data.

    CLI Example:

        salt '*' saltutil.refresh_pillar
    

saltutil.regen_keys:

    Used to regenerate the minion keys.

    CLI Example:

        salt '*' saltutil.regen_keys
    

saltutil.revoke_auth:

    The minion sends a request to the master to revoke its own key.
    Note that the minion session will be revoked and the minion may
    not be able to return the result of this command back to the master.

    CLI Example:

        salt '*' saltutil.revoke_auth
    

saltutil.running:

    Return the data on all running salt processes on the minion

    CLI Example:

        salt '*' saltutil.running
    

saltutil.signal_job:

    Sends a signal to the named salt job's process

    CLI Example:

        salt '*' saltutil.signal_job <job id> 15
    

saltutil.sync_all:

    Sync down all of the dynamic modules from the file server for a specific
    environment

    CLI Example:

        salt '*' saltutil.sync_all
    

saltutil.sync_grains:

    Sync the grains from the _grains directory on the salt master file
    server. This function is environment aware, pass the desired environment
    to grab the contents of the _grains directory, base is the default
    environment.

    CLI Example:

        salt '*' saltutil.sync_grains
    

saltutil.sync_modules:

    Sync the modules from the _modules directory on the salt master file
    server. This function is environment aware, pass the desired environment
    to grab the contents of the _modules directory, base is the default
    environment.

    CLI Example:

        salt '*' saltutil.sync_modules
    

saltutil.sync_outputters:

    Sync the outputters from the _outputters directory on the salt master file
    server. This function is environment aware, pass the desired environment
    to grab the contents of the _outputters directory, base is the default
    environment.

    CLI Example:

        salt '*' saltutil.sync_outputters
    

saltutil.sync_renderers:

    Sync the renderers from the _renderers directory on the salt master file
    server. This function is environment aware, pass the desired environment
    to grab the contents of the _renderers directory, base is the default
    environment.

    CLI Example:

        salt '*' saltutil.sync_renderers
    

saltutil.sync_returners:

    Sync the returners from the _returners directory on the salt master file
    server. This function is environment aware, pass the desired environment
    to grab the contents of the _returners directory, base is the default
    environment.

    CLI Example:

        salt '*' saltutil.sync_returners
    

saltutil.sync_states:

    Sync the states from the _states directory on the salt master file
    server. This function is environment aware, pass the desired environment
    to grab the contents of the _states directory, base is the default
    environment.

    CLI Example:

        salt '*' saltutil.sync_states
    

saltutil.term_job:

    Sends a termination signal (SIGTERM 15) to the named salt job's process

    CLI Example:

        salt '*' saltutil.term_job <job id>
    

saltutil.update:

    Update the salt minion from the URL defined in opts['update_url']


    This feature requires the minion to be running a bdist_esky build.

    The version number is optional and will default to the most recent version
    available at opts['update_url'].

    Returns details about the transaction upon completion.

    CLI Example:

        salt '*' saltutil.update 0.10.3
    

seed.apply:

    Seed a location (disk image, directory, or block device) with the
    minion config, approve the minion's key, and/or install salt-minion.

    CLI Example:

        salt 'minion' seed.whatever path id [config=config_data] \
                [gen_key=(true|false)] [approve_key=(true|false)] \
                [install=(true|false)]

    path
        Full path to the directory, device, or disk image  on the target
        minion's file system.

    id
        Minion id with which to seed the path.

    config
        Minion configuration options. By default, the 'master' option is set to
        the target host's 'master'.

    approve_key
        Request a pre-approval of the generated minion key. Requires
        that the salt-master be configured to either auto-accept all keys or
        expect a signing request from the target host. Default: true.

    install
        Install salt-minion, if absent. Default: true.
    

service.available:

    Return True if the named service is available.  Use the ``limit`` param to
    restrict results to services of that type.

    CLI Examples:

        salt '*' service.available sshd
        salt '*' service.available sshd limit=upstart
        salt '*' service.available sshd limit=sysvinit
    

service.disable:

    Disable the named service to start at boot

    CLI Example:

        salt '*' service.disable <service name>
    

service.disabled:

    Check to see if the named service is disabled to start on boot

    CLI Example:

        salt '*' service.disabled <service name>
    

service.enable:

    Enable the named service to start at boot

    CLI Example:

        salt '*' service.enable <service name>
    

service.enabled:

    Check to see if the named service is enabled to start on boot

    CLI Example:

        salt '*' service.enabled <service name>
    

service.get_all:

    Return all installed services. Use the ``limit`` param to restrict results
    to services of that type.

    CLI Example:

        salt '*' service.get_all
        salt '*' service.get_all limit=upstart
        salt '*' service.get_all limit=sysvinit
    

service.get_disabled:

    Return the disabled services. Use the ``limit`` param to restrict results
    to services of that type.

    CLI Example:

        salt '*' service.get_disabled
        salt '*' service.get_disabled limit=upstart
        salt '*' service.get_disabled limit=sysvinit
    

service.get_enabled:

    Return the enabled services. Use the ``limit`` param to restrict results
    to services of that type.

    CLI Examples:

        salt '*' service.get_enabled
        salt '*' service.get_enabled limit=upstart
        salt '*' service.get_enabled limit=sysvinit
    

service.missing:

    The inverse of service.available.
    Return True if the named service is not available.  Use the ``limit`` param to
    restrict results to services of that type.

    CLI Examples:

        salt '*' service.missing sshd
        salt '*' service.missing sshd limit=upstart
        salt '*' service.missing sshd limit=sysvinit
    

service.reload:

    Reload the named service

    CLI Example:

        salt '*' service.reload <service name>
    

service.restart:

    Restart the named service

    CLI Example:

        salt '*' service.restart <service name>
    

service.start:

    Start the specified service

    CLI Example:

        salt '*' service.start <service name>
    

service.status:

    Return the status for a service, returns a bool whether the service is
    running.

    CLI Example:

        salt '*' service.status <service name>
    

service.stop:

    Stop the specified service

    CLI Example:

        salt '*' service.stop <service name>
    

shadow.default_hash:

    Returns the default hash used for unset passwords

    CLI Example:

        salt '*' shadow.default_hash
    

shadow.info:

    Return information for the specified user

    CLI Example:

        salt '*' shadow.info root
    

shadow.set_date:

    sets the value for the date the password was last changed to the epoch
    (January 1, 1970). See man chage.

    CLI Example:

        salt '*' shadow.set_date username 0
    

shadow.set_inactdays:

    Set the number of days of inactivity after a password has expired before
    the account is locked. See man chage.

    CLI Example:

        salt '*' shadow.set_inactdays username 7
    

shadow.set_maxdays:

    Set the maximum number of days during which a password is valid.
    See man chage.

    CLI Example:

        salt '*' shadow.set_maxdays username 90
    

shadow.set_mindays:

    Set the minimum number of days between password changes. See man chage.

    CLI Example:

        salt '*' shadow.set_mindays username 7
    

shadow.set_password:

    Set the password for a named user. The password must be a properly defined
    hash. The password hash can be generated with this command:

    ``python -c "import crypt; print crypt.crypt('password',
    '\$6\$SALTsalt')"``

    ``SALTsalt`` is the 8-character crpytographic salt. Valid characters in the
    salt are ``.``, ``/``, and any alphanumeric character.

    Keep in mind that the $6 represents a sha512 hash, if your OS is using a
    different hashing algorithm this needs to be changed accordingly

    CLI Example:

        salt '*' shadow.set_password root '$1$UYCIxa628.9qXjpQCjM4a..'
    

shadow.set_warndays:

    Set the number of days of warning before a password change is required.
    See man chage.

    CLI Example:

        salt '*' shadow.set_warndays username 7
    

sqlite3.fetch:

    Retrieve data from an sqlite3 db (returns all rows, be careful!)

    CLI Example:

        salt '*' sqlite3.fetch /root/test.db 'SELECT * FROM test;'
    

sqlite3.indexes:

    Show all indices in the database, for people with poor spelling skills

    CLI Example:

        salt '*' sqlite3.indexes /root/test.db
    

sqlite3.indices:

    Show all indices in the database

    CLI Example:

        salt '*' sqlite3.indices /root/test.db
    

sqlite3.modify:

    Issue an SQL query to sqlite3 (with no return data), usually used
    to modify the database in some way (insert, delete, create, etc)

    CLI Example:

        salt '*' sqlite3.modify /root/test.db 'CREATE TABLE test(id INT, testdata TEXT);'
    

sqlite3.sqlite_version:

    Return version of sqlite

    CLI Example:

        salt '*' sqlite3.sqlite_version
    

sqlite3.tables:

    Show all tables in the database

    CLI Example:

        salt '*' sqlite3.tables /root/test.db
    

sqlite3.version:

    Return version of pysqlite

    CLI Example:

        salt '*' sqlite3.version
    

ssh.auth_keys:

    Return the authorized keys for the specified user

    CLI Example:

        salt '*' ssh.auth_keys root
    

ssh.check_key:

    Check to see if a key needs updating, returns "update", "add" or "exists"

    CLI Example:

        salt '*' ssh.check_key <user> <key> <enc> <comment> <options>
    

ssh.check_key_file:

    Check a keyfile from a source destination against the local keys and
    return the keys to change

    CLI Example:

        salt '*' root salt://ssh/keyfile
    

ssh.check_known_host:

    Check the record in known_hosts file, either by its value or by fingerprint
    (it's enough to set up either key or fingerprint, you don't need to set up
    both).

    If provided key or fingerprint doesn't match with stored value, return
    "update", if no value is found for a given host, return "add", otherwise
    return "exists".

    If neither key, nor fingerprint is defined, then additional validation is
    not performed.

    CLI Example:

        salt '*' ssh.check_known_host <user> <hostname> key='AAAA...FAaQ=='
    

ssh.get_known_host:

    Return information about known host from the configfile, if any.
    If there is no such key, return None.

    CLI Example:

        salt '*' ssh.get_known_host <user> <hostname>
    

ssh.host_keys:

    Return the minion's host keys

    CLI Example:

        salt '*' ssh.host_keys
    

ssh.recv_known_host:

    Retrieve information about host public key from remote server

    CLI Example:

        salt '*' ssh.recv_known_host <hostname> enc=<enc> port=<port>
    

ssh.rm_auth_key:

    Remove an authorized key from the specified user's authorized key file

    CLI Example:

        salt '*' ssh.rm_auth_key <user> <key>
    

ssh.rm_known_host:

    Remove all keys belonging to hostname from a known_hosts file.

    CLI Example:

        salt '*' ssh.rm_known_host <user> <hostname>
    

ssh.set_auth_key:

    Add a key to the authorized_keys file. The "key" parameter must only be the
    string of text that is the encoded key. If the key begins with "ssh-rsa"
    or ends with user@host, remove those from the key before passing it to this
    function.

    CLI Example:

        salt '*' ssh.set_auth_key <user> '<key>' enc='dsa'
    

ssh.set_auth_key_from_file:

    Add a key to the authorized_keys file, using a file as the source.

    CLI Example:

        salt '*' ssh.set_auth_key_from_file <user>                salt://ssh_keys/<user>.id_rsa.pub
    

ssh.set_known_host:

    Download SSH public key from remote host "hostname", optionally validate
    its fingerprint against "fingerprint" variable and save the record in the
    known_hosts file.

    If such a record does already exists in there, do nothing.


    CLI Example:

        salt '*' ssh.set_known_host <user> fingerprint='xx:xx:..:xx'                  enc='ssh-rsa' config='.ssh/known_hosts'
    

state.clear_cache:

    Clear out cached state files, forcing even cache runs to refresh the cache
    on the next state execution.

    Remember that the state cache is completely disabled by default, this
    execution only applies if cache=True is used in states

    CLI Example:

        salt '*' state.clear_cache
    

state.high:

    Execute the compound calls stored in a single set of high data
    This function is mostly intended for testing the state system

    CLI Example:

        salt '*' state.high '{"vim": {"pkg": ["installed"]}}'
    

state.highstate:

    Retrieve the state data from the salt master for this minion and execute it

    CLI Example:

        salt '*' state.highstate

        salt '*' state.highstate exclude=sls_to_exclude
        salt '*' state.highstate exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"
    

state.low:

    Execute a single low data call
    This function is mostly intended for testing the state system

    CLI Example:

        salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}'
    

state.pkg:

    Execute a packaged state run, the packaged state run will exist in a
    tarball available locally. This packaged state
    can be generated using salt-ssh.

    CLI Example:

        salt '*' state.pkg /tmp/state_pkg.tgz
    

state.running:

    Return a dict of state return data if a state function is already running.
    This function is used to prevent multiple state calls from being run at
    the same time.

    CLI Example:

        salt '*' state.running
    

state.show_highstate:

    Retrieve the highstate data from the salt master and display it

    CLI Example:

        salt '*' state.show_highstate
    

state.show_low_sls:

    Display the low data from a specific sls. The default environment is
    ``base``, use ``saltenv`` (``env`` in Salt 0.17.x and older) to specify a
    different environment.

    CLI Example:

        salt '*' state.show_low_sls foo
    

state.show_lowstate:

    List out the low data that will be applied to this minion

    CLI Example:

        salt '*' state.show_lowstate
    

state.show_sls:

    Display the state data from a specific sls or list of sls files on the
    master. The default environment is ``base``, use ``saltenv`` (``env`` in
    Salt 0.17.x and older) to specify a different environment.

    This function does not support topfiles.  For ``top.sls`` please use
    ``show_top`` instead.

    CLI Example:

        salt '*' state.show_sls core,edit.vim dev
    

state.show_top:

    Return the top data that the minion will use for a highstate

    CLI Example:

        salt '*' state.show_top
    

state.single:

    Execute a single state function with the named kwargs, returns False if
    insufficient data is sent to the command

    By default, the values of the kwargs will be parsed as YAML. So, you can
    specify lists values, or lists of single entry key-value maps, as you
    would in a YAML salt file. Alternatively, JSON format of keyword values
    is also supported.

    CLI Example:

        salt '*' state.single pkg.installed name=vim

    

state.sls:

    Execute a set list of state modules from an environment. The default
    environment is ``base``, use ``saltenv`` (``env`` in Salt 0.17.x and older)
    to specify a different environment

    CLI Example:

        salt '*' state.sls core,edit.vim dev
        salt '*' state.sls core exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"
    

state.template:

    Execute the information stored in a template file on the minion

    CLI Example:

        salt '*' state.template '<Path to template on the minion>'
    

state.template_str:

    Execute the information stored in a string from an sls template

    CLI Example:

        salt '*' state.template_str '<Template String>'
    

state.top:

    Execute a specific top file instead of the default

    CLI Example:

        salt '*' state.top reverse_top.sls
        salt '*' state.top reverse_top.sls exclude=sls_to_exclude
        salt '*' state.top reverse_top.sls exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"
    

status.all_status:

    Return a composite of all status data and info for this minion.
    Warning: There is a LOT here!

    CLI Example:

        salt '*' status.all_status
    

status.cpuinfo:

    Return the CPU info for this minion

    CLI Example:

        salt '*' status.cpuinfo
    

status.cpustats:

    Return the CPU stats for this minion

    CLI Example:

        salt '*' status.cpustats
    

status.custom:

    Return a custom composite of status data and info for this minion,
    based on the minion config file. An example config like might be::

        status.cpustats.custom: [ 'cpu', 'ctxt', 'btime', 'processes' ]

    Where status refers to status.py, cpustats is the function
    where we get our data, and custom is this function It is followed
    by a list of keys that we want returned.

    This function is meant to replace all_status(), which returns
    anything and everything, which we probably don't want.

    By default, nothing is returned. Warning: Depending on what you
    include, there can be a LOT here!

    CLI Example:

        salt '*' status.custom
    

status.diskstats:

    Return the disk stats for this minion

    CLI Example:

        salt '*' status.diskstats
    

status.diskusage:

    Return the disk usage for this minion

    Usage::

        salt '*' status.diskusage [paths and/or filesystem types]

    CLI Example:

        salt '*' status.diskusage         # usage for all filesystems
        salt '*' status.diskusage / /tmp  # usage for / and /tmp
        salt '*' status.diskusage ext?    # usage for ext[234] filesystems
        salt '*' status.diskusage / ext?  # usage for / and all ext filesystems
    

status.loadavg:

    Return the load averages for this minion

    CLI Example:

        salt '*' status.loadavg
    

status.meminfo:

    Return the CPU stats for this minion

    CLI Example:

        salt '*' status.meminfo
    

status.netdev:

    Return the network device stats for this minion

    CLI Example:

        salt '*' status.netdev
    

status.netstats:

    Return the network stats for this minion

    CLI Example:

        salt '*' status.netstats
    

status.pid:

    Return the PID or an empty string if the process is running or not.
    Pass a signature to use to find the process via ps.

    CLI Example:

        salt '*' status.pid <sig>
    

status.procs:

    Return the process data

    CLI Example:

        salt '*' status.procs
    

status.uptime:

    Return the uptime for this minion

    CLI Example:

        salt '*' status.uptime
    

status.version:

    Return the system version for this minion

    CLI Example:

        salt '*' status.version
    

status.vmstats:

    Return the virtual memory stats for this minion

    CLI Example:

        salt '*' status.vmstats
    

status.w:

    Return a list of logged in users for this minion, using the w command

    CLI Example:

        salt '*' status.w
    

supervisord.add:

    Activates any updates in config for process/group.

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.add <name>
    

supervisord.custom:

    Run any custom supervisord command

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.custom "mstop '*gunicorn*'"
    

supervisord.options:

    New in version 2014.1.0 (Hydrogen)

    Read the config file and return the config options for a given process

    name
        Name of the configured process
    conf_file
        path to supervisord config file

    CLI Example:

        salt '*' supervisord.options foo
    

supervisord.remove:

    Removes process/group from active config

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.remove <name>
    

supervisord.reread:

    Reload the daemon's configuration files

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.reread
    

supervisord.restart:

    Restart the named service.
    Process group names should not include a trailing asterisk.

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.restart <service>
        salt '*' supervisord.restart <group>:
    

supervisord.start:

    Start the named service.
    Process group names should not include a trailing asterisk.

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.start <service>
        salt '*' supervisord.start <group>:
    

supervisord.status:

    List programs and its state

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.status
    

supervisord.status_raw:

    Display the raw output of status

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.status_raw
    

supervisord.stop:

    Stop the named service.
    Process group names should not include a trailing asterisk.

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.stop <service>
        salt '*' supervisord.stop <group>:
    

supervisord.update:

    Reload config and add/remove as necessary

    user
        user to run supervisorctl as
    conf_file
        path to supervisord config file
    bin_env
        path to supervisorctl bin or path to virtualenv with supervisor
        installed

    CLI Example:

        salt '*' supervisord.update
    

svn.add:

    Add files to be tracked by the Subversion working-copy checkout

    cwd
        The path to the Subversion repository

    targets : None
        files and directories to pass to the command as arguments

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    CLI Example:

        salt '*' svn.add /path/to/repo /path/to/new/file
    

svn.checkout:

    Download a working copy of the remote Subversion repository
    directory or file

    cwd
        The path to the Subversion repository

    remote : None
        URL to checkout

    target : None
        The name to give the file or directory working copy
        Default: svn uses the remote basename

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    CLI Example:

        salt '*' svn.checkout /path/to/repo svn://remote/repo
    

svn.commit:

    Commit the current directory, files, or directories to
    the remote Subversion repository

    cwd
        The path to the Subversion repository

    targets : None
        files and directories to pass to the command as arguments
        Default: svn uses '.'

    msg : None
        Message to attach to the commit log

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    CLI Example:

        salt '*' svn.commit /path/to/repo
    

svn.diff:

    Return the diff of the current directory, files, or directories from
    the remote Subversion repository

    cwd
        The path to the Subversion repository

    targets : None
        files and directories to pass to the command as arguments
        Default: svn uses '.'

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    CLI Example:

        salt '*' svn.diff /path/to/repo
    

svn.export:

    Create an unversioned copy of a tree.

    cwd
        The path to the Subversion repository

    remote : None
        URL and path to file or directory checkout

    target : None
        The name to give the file or directory working copy
        Default: svn uses the remote basename

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    CLI Example:

        salt '*' svn.export /path/to/repo svn://remote/repo
    

svn.info:

    Display the Subversion information from the checkout.

    cwd
        The path to the Subversion repository

    targets : None
        files, directories, and URLs to pass to the command as arguments
        svn uses '.' by default

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    fmt : str
        How to fmt the output from info.
        (str, xml, list, dict)

    CLI Example:

        salt '*' svn.info /path/to/svn/repo
    

svn.remove:

    Remove files and directories from the Subversion repository

    cwd
        The path to the Subversion repository

    targets : None
        files, directories, and URLs to pass to the command as arguments

    msg : None
        Message to attach to the commit log

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    CLI Example:

        salt '*' svn.remove /path/to/repo /path/to/repo/remove
    

svn.status:

    Display the status of the current directory, files, or
    directories in the Subversion repository

    cwd
        The path to the Subversion repository

    targets : None
        files, directories, and URLs to pass to the command as arguments
        Default: svn uses '.'

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    CLI Example:

        salt '*' svn.status /path/to/repo
    

svn.switch:

    New in version 2014.1.0 (Hydrogen)

    Switch a working copy of a remote Subversion repository
    directory

    cwd
        The path to the Subversion repository

    remote : None
        URL to switch

    target : None
        The name to give the file or directory working copy
        Default: svn uses the remote basename

    user : None
        Run svn as a user other than what the minion runs as

    username : None
        Connect to the Subversion server as another user

    password : None
        Connect to the Subversion server with this password

    CLI Example::

        salt '*' svn.switch /path/to/repo svn://remote/repo
    

svn.update:

    Update the current directory, files, or directories from
    the remote Subversion repository

    cwd
        The path to the Subversion repository

    targets : None
        files and directories to pass to the command as arguments
        Default: svn uses '.'

    user : None
        Run svn as a user other than what the minion runs as

    password : None
        Connect to the Subversion server with this password

        New in version 0.17.0

    username : None
        Connect to the Subversion server as another user

    CLI Example:

        salt '*' svn.update /path/to/repo
    

sys.argspec:

    Return the argument specification of functions in Salt execution
    modules.

    CLI Example:

        salt '*' sys.argspec pkg.install
        salt '*' sys.argspec sys
        salt '*' sys.argspec
    

sys.doc:

    Return the docstrings for all modules. Optionally, specify a module or a
    function to narrow the selection.

    The strings are aggregated into a single document on the master for easy
    reading.

    Multiple modules/functions can be specified.

    CLI Example:

        salt '*' sys.doc
        salt '*' sys.doc sys
        salt '*' sys.doc sys.doc
        salt '*' sys.doc network.traceroute user.info
    

sys.list_functions:

    List the functions for all modules. Optionally, specify a module or modules
    from which to list.

    CLI Example:

        salt '*' sys.list_functions
        salt '*' sys.list_functions sys
        salt '*' sys.list_functions sys user
    

sys.list_modules:

    List the modules loaded on the minion

    CLI Example:

        salt '*' sys.list_modules
    

sys.reload_modules:

    Tell the minion to reload the execution modules

    CLI Example:

        salt '*' sys.reload_modules
    

sysctl.assign:

    Assign a single sysctl parameter for this minion

    CLI Example:

        salt '*' sysctl.assign net.ipv4.ip_forward 1
    

sysctl.default_config:

    Linux hosts using systemd 207 or later ignore ``/etc/sysctl.conf`` and only
    load from ``/etc/sysctl.d/*.conf``. This function will do the proper checks
    and return a default config file which will be valid for the Minion. Hosts
    running systemd >= 207 will use ``/etc/sysctl.d/99-salt.conf``.

    CLI Example:

        salt -G 'kernel:Linux' sysctl.default_config
    

sysctl.get:

    Return a single sysctl parameter for this minion

    CLI Example:

        salt '*' sysctl.get net.ipv4.ip_forward
    

sysctl.persist:

    Assign and persist a simple sysctl parameter for this minion. If ``config``
    is not specified, a sensible default will be chosen using
    :mod:`sysctl.default_config <salt.modules.linux_sysctl.default_config>`.

    CLI Example:

        salt '*' sysctl.persist net.ipv4.ip_forward 1
    

sysctl.show:

    Return a list of sysctl parameters for this minion

    CLI Example:

        salt '*' sysctl.show
    

system.halt:

    Halt a running system

    CLI Example:

        salt '*' system.halt
    

system.init:

    Change the system runlevel on sysV compatible systems

    CLI Example:

        salt '*' system.init 3
    

system.poweroff:

    Poweroff a running system

    CLI Example:

        salt '*' system.poweroff
    

system.reboot:

    Reboot the system using the 'reboot' command

    CLI Example:

        salt '*' system.reboot
    

system.shutdown:

    Shutdown a running system

    CLI Example:

        salt '*' system.shutdown
    

test.arg:

    Print out the data passed into the function ``*args`` and ```kwargs``, this
    is used to both test the publication data and cli argument passing, but
    also to display the information available within the publication data.
    Returns {"args": args, "kwargs": kwargs}.

    CLI Example:

        salt '*' test.arg 1 "two" 3.1 txt="hello" wow='{a: 1, b: "hello"}'
    

test.arg_repr:

    Print out the data passed into the function ``*args`` and ```kwargs``, this
    is used to both test the publication data and cli argument passing, but
    also to display the information available within the publication data.
    Returns {"args": repr(args), "kwargs": repr(kwargs)}.

    CLI Example:

        salt '*' test.arg_repr 1 "two" 3.1 txt="hello" wow='{a: 1, b: "hello"}'
    

test.arg_type:

    Print out the types of the args and kwargs. This is used to test the types
    of the args and kwargs passed down to the minion

    CLI Example:

           salt '*' test.arg_type 1 'int'
    

test.collatz:

    Execute the collatz conjecture from the passed starting number,
    returns the sequence and the time it took to compute. Used for
    performance tests.

    CLI Example:

        salt '*' test.collatz 3
    

test.conf_test:

    Return the value for test.foo in the minion configuration file, or return
    the default value

    CLI Example:

        salt '*' test.conf_test
    

test.cross_test:

    Execute a minion function via the __salt__ object in the test
    module, used to verify that the minion functions can be called
    via the __salt__ module.

    CLI Example:

        salt '*' test.cross_test file.gid_to_group 0
    

test.echo:

    Return a string - used for testing the connection

    CLI Example:

        salt '*' test.echo 'foo bar baz quo qux'
    

test.fib:

    Return a Fibonacci sequence up to the passed number, and the
    timeit took to compute in seconds. Used for performance tests

    CLI Example:

        salt '*' test.fib 3
    

test.get_opts:

    Return the configuration options passed to this minion

    CLI Example:

        salt '*' test.get_opts
    

test.kwarg:

    Print out the data passed into the function ``**kwargs``, this is used to
    both test the publication data and cli kwarg passing, but also to display
    the information available within the publication data.

    CLI Example:

        salt '*' test.kwarg num=1 txt="two" env='{a: 1, b: "hello"}'
    

test.not_loaded:

    List the modules that were not loaded by the salt loader system

    CLI Example:

        salt '*' test.not_loaded
    

test.opts_pkg:

    Return an opts package with the grains and opts for this minion.
    This is primarily used to create the options used for master side
    state compiling routines

    CLI Example:

        salt '*' test.opts_pkg
    

test.outputter:

    Test the outputter, pass in data to return

    CLI Example:

        salt '*' test.outputter foobar
    

test.ping:

    Just used to make sure the minion is up and responding
    Return True

    CLI Example:

        salt '*' test.ping
    

test.provider:

    Pass in a function name to discover what provider is being used

    CLI Example:

        salt '*' test.provider service
    

test.providers:

    Return a dict of the provider names and the files that provided them

    CLI Example:

        salt '*' test.providers
    

test.rand_sleep:

    Sleep for a random number of seconds, used to test long-running commands
    and minions returning at differing intervals

    CLI Example:

        salt '*' test.rand_sleep 60
    

test.retcode:

    Test that the returncode system is functioning correctly

    CLI Example:

        salt '*' test.retcode 42
    

test.sleep:

    Instruct the minion to initiate a process that will sleep for a given
    period of time.

    CLI Example:

        salt '*' test.sleep 20
    

test.tty:

    Echo a string to a specific tty

    CLI Example:

        salt '*' test.tty tty0 'This is a test'
        salt '*' test.tty pts3 'This is a test'
    

test.version:

    Return the version of salt on the minion

    CLI Example:

        salt '*' test.version
    

test.versions_information:

    Returns versions of components used by salt as a dict

    CLI Example:

        salt '*' test.versions_information
    

test.versions_report:

    Returns versions of components used by salt

    CLI Example:

        salt '*' test.versions_report
    

timezone.get_hwclock:

    Get current hardware clock setting (UTC or localtime)

    CLI Example:

        salt '*' timezone.get_hwclock
    

timezone.get_offset:

    Get current numeric timezone offset from UCT (i.e. -0700)

    CLI Example:

        salt '*' timezone.get_offset
    

timezone.get_zone:

    Get current timezone (i.e. America/Denver)

    CLI Example:

        salt '*' timezone.get_zone
    

timezone.get_zonecode:

    Get current timezone (i.e. PST, MDT, etc)

    CLI Example:

        salt '*' timezone.get_zonecode
    

timezone.set_hwclock:

    Sets the hardware clock to be either UTC or localtime

    CLI Example:

        salt '*' timezone.set_hwclock UTC
    

timezone.set_zone:

    Unlinks, then symlinks /etc/localtime to the set timezone.

    The timezone is crucial to several system processes, each of which SHOULD
    be restarted (for instance, whatever you system uses as its cron and
    syslog daemons). This will not be magically done for you!

    CLI Example:

        salt '*' timezone.set_zone 'America/Denver'
    

timezone.zone_compare:

    Checks the md5sum between the given timezone, and the one set in
    /etc/localtime. Returns True if they match, and False if not. Mostly useful
    for running state checks.

    CLI Example:

        salt '*' timezone.zone_compare 'America/Denver'
    

user.add:

    Add a user to the minion

    CLI Example:

        salt '*' user.add name <uid> <gid> <groups> <home> <shell>
    

user.chfullname:

    Change the user's Full Name

    CLI Example:

        salt '*' user.chfullname foo "Foo Bar"
    

user.chgid:

    Change the default group of the user

    CLI Example:

        salt '*' user.chgid foo 4376
    

user.chgroups:

    Change the groups this user belongs to, add append to append the specified
    groups

    CLI Example:

        salt '*' user.chgroups foo wheel,root True
    

user.chhome:

    Change the home directory of the user, pass true for persist to copy files
    to the new home dir

    CLI Example:

        salt '*' user.chhome foo /home/users/foo True
    

user.chhomephone:

    Change the user's Home Phone

    CLI Example:

        salt '*' user.chhomephone foo "7735551234"
    

user.chroomnumber:

    Change the user's Room Number

    CLI Example:

        salt '*' user.chroomnumber foo 123
    

user.chshell:

    Change the default shell of the user

    CLI Example:

        salt '*' user.chshell foo /bin/zsh
    

user.chuid:

    Change the uid for a named user

    CLI Example:

        salt '*' user.chuid foo 4376
    

user.chworkphone:

    Change the user's Work Phone

    CLI Example:

        salt '*' user.chworkphone foo "7735550123"
    

user.delete:

    Remove a user from the minion

    CLI Example:

        salt '*' user.delete name remove=True force=True
    

user.getent:

    Return the list of all info for all users

    CLI Example:

        salt '*' user.getent
    

user.info:

    Return user information

    CLI Example:

        salt '*' user.info root
    

user.list_groups:

    Return a list of groups the named user belongs to

    CLI Example:

        salt '*' user.list_groups foo
    

user.list_users:

    Return a list of all users

    CLI Example:

        salt '*' user.list_users
    

virtualenv.create:

    Create a virtualenv

    path
        The path to create the virtualenv
    venv_bin : None (default 'virtualenv')
        The name (and optionally path) of the virtualenv command. This can also
        be set globally in the minion config file as ``virtualenv.venv_bin``.
    no_site_packages : None
        Passthrough argument given to virtualenv if True. Deprecated since
        ``salt>=0.17.0``. Use ``system_site_packages=False`` instead.
    system_site_packages : False
        Passthrough argument given to virtualenv or pyvenv
    distribute : False
        Passthrough argument given to virtualenv
    pip : False
        Install pip after creating a virtual environment,
        implies distribute=True
    clear : False
        Passthrough argument given to virtualenv or pyvenv
    python : None (default)
        Passthrough argument given to virtualenv
    extra_search_dir : None (default)
        Passthrough argument given to virtualenv
    never_download : None (default)
        Passthrough argument given to virtualenv if True
    prompt : None (default)
        Passthrough argument given to virtualenv if not None
    symlinks : None
        Passthrough argument given to pyvenv if True
    upgrade : None
        Passthrough argument given to pyvenv if True
    user : None
        Set ownership for the virtualenv
    runas : None
        Set ownership for the virtualenv

    Note:
        The ``runas`` argument is deprecated as of Hydrogen. ``user`` should be
        used instead.

    CLI Example:

        salt '*' virtualenv.create /path/to/new/virtualenv
    

virtualenv.get_site_packages:

    Returns the path to the site-packages directory inside a virtualenv

    CLI Example:

        salt '*' virtualenv.get_site_packages /path/to/my/venv
    

webutil.useradd:

    Add an HTTP user using the htpasswd command. If the htpasswd file does not
    exist, it will be created. Valid options that can be passed are:

        n  Don't update file; display results on stdout.
        m  Force MD5 encryption of the password (default).
        d  Force CRYPT encryption of the password.
        p  Do not encrypt the password (plaintext).
        s  Force SHA encryption of the password.

    CLI Examples:

        salt '*' webutil.useradd /etc/httpd/htpasswd larry badpassword
        salt '*' webutil.useradd /etc/httpd/htpasswd larry badpass opts=ns
    

webutil.userdel:

    Delete an HTTP user from the specified htpasswd file.

    CLI Examples:

        salt '*' webutil.userdel /etc/httpd/htpasswd larry
    


5 thoughts on “saltstack sys.doc”

发表评论

电子邮件地址不会被公开。 必填项已用*标注