neulab/tldr huggingface dataset:
salt myminion docker.prune system=True salt myminion docker.prune system=True until=12h salt myminion docker.prune images=True dangling=True salt myminion docker.prune images=True label=foo,bar=baz
salt.modules.dockermod.ps_(filters=None, **kwargs) Returns information about the Docker containers on the Minion. Equivalent to running the docker ps Docker CLI command.
all    False If True, stopped containers will also be returned
host: False If True, local host's network topology will be included
verbose False If True, a docker inspect will be run on each container returned.
filters: None A dictionary of filters to be processed on the container list.  Available filters:
• exited (int): Only containers with specified exit code
• status (str): One of restarting, running, paused, exited
• label (str): format either "key" or "key=value"
A dictionary with each key being an container ID, and each value some general info about that container (time created, name, command, etc.)
salt myminion docker.ps salt myminion docker.ps all=True salt myminion docker.ps filters="{'label': 'role=web'}"
salt.modules.dockermod.pull(image, insecure_registry=False, api_response=False, client_timeout=60) Changed in version 2018.3.0: If no tag is specified in the image argument, all tags for the image will be pulled. For this reason is it recommended to pass image using the repo:tag notation.
Pulls an image from a Docker registry
image  Image to be pulled
insecure_registry False If True, the Docker client will permit the use of insecure (non-HTTPS) registries.
api_response False If True, an API_Response key will be present in the return data, containing the raw output from the Docker API.
NOTE: This may result in a lot of additional return data, especially for larger images.
client_timeout Timeout in seconds for the Docker client. This is not a timeout for this function, but for receiving a response from the API.
Layers - A dictionary containing one or more of the following keys:
• Time_Elapsed - Time in seconds taken to perform the pull
salt myminion docker.pull centos salt myminion docker.pull centos:6
salt.modules.dockermod.push(image, insecure_registry=False, api_response=False, client_timeout=60) Changed in version 2015.8.4: The Id and Image keys are no longer present in the return data.  This is due to changes in the Docker Remote API.
Pushes an image to a Docker registry. See the documentation at top of this page to configure authentication credentials.
image  Image to be pushed. If just the repository name is passed, then all tagged images for the specified repo will be pushed. If the image name is passed in repo:tag notation, only the specified image will be pushed.
• Already_Pushed - Layers that that were already present on the Minion
• Pushed - Layers that that were pushed
• Time_Elapsed - Time in seconds taken to perform the push
salt myminion docker.push myuser/mycontainer salt myminion docker.push myuser/mycontainer:mytag
salt.modules.dockermod.remove_network(network_id) Remove a network
salt myminion docker.remove_network mynet salt myminion docker.remove_network 1f9d2454d0872b68dd9e8744c6e7a4c66b86f10abaccc21e14f7f014f729b2bc
salt.modules.dockermod.remove_volume(name) Remove a volume
salt myminion docker.remove_volume my_volume
salt.modules.dockermod.rename(name, new_name) New in version 2017.7.0.
Renames a container. Returns True if successful, and raises an error if the API returns one. If unsuccessful and the API returns no error (should not happen), then False will be returned.
name   Name or ID of existing container
new_name New name to assign to container
salt myminion docker.rename foo bar
salt.modules.dockermod.resolve_image_id(name) New in version 2018.3.0.
Given an image name (or partial image ID), return the full image ID. If no match is found among the locally-pulled images, then False will be returned.
salt myminion docker.resolve_image_id foo salt myminion docker.resolve_image_id foo:bar salt myminion docker.resolve_image_id 36540f359ca3
salt.modules.dockermod.resolve_tag(name, **kwargs) New in version 2017.7.2.
Changed in version 2018.3.0: Instead of matching against pulled tags using docker.list_tags, this function now simply inspects the passed image name using docker.inspect_image and returns the first matching tag. If no matching tags are found, it is assumed that the passed image is an untagged image ID, and the full ID is returned.
Inspects the specified image name and returns the first matching tag in the inspect results. If the specified image is not pulled locally, this function will return False.
name   Image name to resolve. If the image is found but there are no tags, this means that the image name passed was an untagged image. In this case the image ID will be returned.
all    False If True, a list of all matching tags will be returned. If the image is found but there are no tags, then a list will still be returned, but it will simply contain the image ID.
tags   Deprecated since version 2018.3.0.
salt myminion docker.resolve_tag busybox salt myminion docker.resolve_tag centos:7 all=True salt myminion docker.resolve_tag c9f378ac27d9
salt.modules.dockermod.restart(name, timeout=10) Restarts a container
timeout 10 Timeout in seconds after which the container will be killed (if it has not yet gracefully shut down)
• restarted - If restart was successful, this key will be present and will be set to True.
salt myminion docker.restart mycontainer salt myminion docker.restart mycontainer timeout=20
salt.modules.dockermod.retcode(name, cmd, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.retcode within a container
name   Container name or ID in which to run the command
cmd    Command to run
stdin  None Standard input to be used for the command
output_loglevel debug Level at which to log the output from the command. Set to quiet to suppress logging.
use_vt False Use SaltStack's utils.vt to stream output to console.
keep_env None If not passed, only a sane default PATH environment variable will be set. If True, all environment variables from the container's host will be kept. Otherwise, a comma-separated list (or Python list) of environment variable names can be passed, and those environment variables will be kept.
salt myminion docker.retcode mycontainer 'ls -l /etc'
salt.modules.dockermod.rm_(name, force=False, volumes=False, **kwargs) Removes a container
force  False If True, the container will be killed first before removal, as the Docker API will not permit a running container to be removed. This option is set to False by default to prevent accidental removal of a running container.
stop   False If True, the container will be stopped first before removal, as the Docker API will not permit a running container to be removed. This option is set to False by default to prevent accidental removal of a running container.
timeout Optional timeout to be passed to docker.stop if stopping the container.
volumes False Also remove volumes associated with container
A list of the IDs of containers which were removed
salt myminion docker.rm mycontainer salt myminion docker.rm mycontainer force=True
salt.modules.dockermod.rmi(*names, **kwargs) Removes an image
name   Name (in repo:tag notation) or ID of image.
force  False If True, the image will be removed even if the Minion has containers created from that image
prune  True If True, untagged parent image layers will be removed as well, set this to False to keep them.
A dictionary will be returned, containing the following two keys:
• Layers - A list of the IDs of image layers that were removed
• Tags - A list of the tags that were removed
• Errors - A list of any errors that were encountered
salt myminion docker.rmi busybox salt myminion docker.rmi busybox force=True salt myminion docker.rmi foo bar baz
salt.modules.dockermod.run(name, cmd, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run within a container
salt myminion docker.run mycontainer 'ls -l /etc'
salt.modules.dockermod.run_all(name, cmd, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run_all within a container
NOTE: While the command is run within the container, it is initiated from the host. Therefore, the PID in the return dict is from the host, not from the container.
salt myminion docker.run_all mycontainer 'ls -l /etc'
salt.modules.dockermod.run_container(image, name=None, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, client_timeout=60, bg=False, replace=False, force=False, networks=None, **kwargs) New in version 2018.3.0.
Equivalent to docker run on the Docker CLI. Runs the container, waits for it to exit, and returns the container's logs when complete.
NOTE: Not to be confused with docker.run, which provides a cmd.run-like interface for executing commands in a running container.
This function accepts the same arguments as docker.create, with the exception of start. In addition, it accepts the arguments from docker.logs, with the exception of follow, to control how logs are returned. Finally, the bg argument described below can be used to optionally run the container in the background (the default behavior is to block until the container exits).
bg     False If True, this function will not wait for the container to exit and will not return its logs. It will however return the container's name and ID, allowing for docker.logs to be used to view the logs.
NOTE: The logs will be inaccessible once the container exits if auto_remove is set to True, so keep this in mind.
replace False If True, and if the named container already exists, this will remove the existing container. The default behavior is to return a False result when the container already exists.
force  False If True, and the named container already exists, and replace is also set to True, then the container will be forcibly removed.  Otherwise, the state will not proceed and will return a False result.
networks Networks to which the container should be connected. If automatic IP configuration is being used, the networks can be a simple list of network names. If custom IP configuration is being used, then this argument must be passed as a dictionary.
salt myminion docker.run_container myuser/myimage command=/usr/local/bin/myscript.sh # Run container in the background salt myminion docker.run_container myuser/myimage command=/usr/local/bin/myscript.sh bg=True # Connecting to two networks using automatic IP configuration salt myminion docker.run_container myuser/myimage command='perl /scripts/sync.py' networks=net1,net2 # net1 using automatic IP, net2 using static IPv4 address salt myminion docker.run_container myuser/myimage command='perl /scripts/sync.py' networks='{"net1": {}, "net2": {"ipv4_address": "192.168.27.12"}}'
salt.modules.dockermod.run_stderr(name, cmd, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run_stderr within a container
salt myminion docker.run_stderr mycontainer 'ls -l /etc'
salt.modules.dockermod.run_stdout(name, cmd, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run_stdout within a container
salt myminion docker.run_stdout mycontainer 'ls -l /etc'
salt.modules.dockermod.save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs) Saves an image and to a file on the minion. Equivalent to running the docker save Docker CLI command, but unlike docker save this will also work on named images instead of just images IDs.
name   Name or ID of image. Specify a specific tag by using the repo:tag notation.
path   Absolute path on the Minion where the image will be exported
overwrite False Unless this option is set to True, then if the destination file exists an error will be raised.
NOTE: Since the Docker API does not support docker save, compression will be a bit slower with this function than with docker.export since the image(s) will first be saved and then the compression done afterwards.
• Time_Elapsed - Time in seconds taken to perform the save
salt myminion docker.save centos:7 /tmp/cent7.tar salt myminion docker.save 0123456789ab cdef01234567 /tmp/saved.tar
salt.modules.dockermod.script(name, source, saltenv='base', args=None, template=None, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=None) Run cmd.script within a container
source Path to the script. Can be a local path on the Minion or a remote file from the Salt fileserver.
args   A string containing additional command-line options to pass to the script.
template None Templating engine to use on the script before running.
stdin  None Standard input to be used for the script
output_loglevel debug Level at which to log the output from the script. Set to quiet to suppress logging.
salt myminion docker.script mycontainer salt://docker_script.py salt myminion docker.script mycontainer salt://scripts/runme.sh 'arg1 arg2 "arg 3"' salt myminion docker.script mycontainer salt://scripts/runme.sh stdin='one\ntwo\nthree\nfour\nfive\n' output_loglevel=quiet
salt.modules.dockermod.script_retcode(name, source, saltenv='base', args=None, template=None, exec_driver=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=None) Run cmd.script_retcode within a container
salt myminion docker.script_retcode mycontainer salt://docker_script.py salt myminion docker.script_retcode mycontainer salt://scripts/runme.sh 'arg1 arg2 "arg 3"' salt myminion docker.script_retcode mycontainer salt://scripts/runme.sh stdin='one\ntwo\nthree\nfour\nfive\n' output_loglevel=quiet
salt.modules.dockermod.search(name, official=False, trusted=False) Searches the registry for an image
name   Search keyword
official False Limit results to official builds
trusted False Limit results to trusted builds
A dictionary with each key being the name of an image, and the following information for each image:
• Description - Image description
• Official - A boolean (True if an official build, False if not)
• Stars - Number of stars the image has on the registry
• Trusted - A boolean (True if a trusted build, False if not)
salt myminion docker.search centos salt myminion docker.search centos official=True
salt.modules.dockermod.signal_(name, signal) Send a signal to a container. Signals can be either strings or numbers, and are defined in the Standard Signals section of the signal(7) manpage. Run man 7 signal on a Linux host to browse this manpage.
signal Signal to send to container
If the signal was successfully sent, True will be returned. Otherwise, an error will be raised.
salt myminion docker.signal mycontainer SIGHUP
salt.modules.dockermod.sls(name, mods=None, **kwargs) Apply the states defined by the specified SLS modules to the running container
mods   None A string containing comma-separated list of SLS with defined states to apply to the container.
pillarenv Specify a Pillar environment to be used when applying states. This can also be set in the minion config file using the pillarenv option. When neither the pillarenv minion config option nor this CLI argument is used, all Pillar environments will be merged together.
pillar Custom Pillar values, passed as a dictionary of key-value pairs
NOTE: Values passed this way will override Pillar values set via pillar_roots or an external Pillar source.
salt myminion docker.sls compassionate_mirzakhani mods=rails,web
salt.modules.dockermod.sls_build(repository, tag='latest', base='opensuse/python', mods=None, dryrun=False, **kwargs) Changed in version 2018.3.0: The repository and tag must now be passed separately using the repository and tag arguments, rather than together in the (now deprecated) image argument.
Build a Docker image using the specified SLS modules on top of base image
The base image does not need to have Salt installed, but Python is required.
repository Repository name for the image to be built
tag    latest Tag name for the image to be built
name   Deprecated since version 2018.3.0: Use both repository and tag instead
base   opensuse/python Name or ID of the base image
mods   A string containing comma-separated list of SLS with defined states to apply to the base image.
dryrun: False when set to True the container will not be committed at the end of the build. The dryrun succeed also when the state contains errors.
A dictionary with the ID of the new container. In case of a dryrun, the state result is returned and the container gets removed.
salt myminion docker.sls_build imgname base=mybase mods=rails,web
salt.modules.dockermod.start_(name) Start a container
• comment - Only present if the container cannot be started
salt myminion docker.start mycontainer
salt.modules.dockermod.state(name) Returns the state of the container
A string representing the current state of the container (either running, paused, or stopped)
salt myminion docker.state mycontainer
salt.modules.dockermod.stop(name, timeout=None, **kwargs) Stops a running container
unpause False If True and the container is paused, it will be unpaused before attempting to stop the container.
timeout Timeout in seconds after which the container will be killed (if it has not yet gracefully shut down)
Changed in version 2017.7.0: If this argument is not passed, then the container's configuration will be checked. If the container was created using the stop_timeout argument, then the configured timeout will be used, otherwise the timeout will be 10 seconds.
• comment - Only present if the container can not be stopped
salt myminion docker.stop mycontainer salt myminion docker.stop mycontainer unpause=True salt myminion docker.stop mycontainer timeout=20
salt.modules.dockermod.tag_(name, repository, tag='latest', force=False) Changed in version 2018.3.0: The repository and tag must now be passed separately using the repository and tag arguments, rather than together in the (now deprecated) image argument.
Tag an image into a repository and return True. If the tag was unsuccessful, an error will be raised.
name   ID of image
force  False Force apply tag
salt myminion docker.tag 0123456789ab myrepo/mycontainer mytag
salt.modules.dockermod.top(name) Runs the docker top command on a specific container
A list of dictionaries containing information about each process
salt myminion docker.top mycontainer salt myminion docker.top 0123456789ab
salt.modules.dockermod.unfreeze(name) This function is an alias of unpause. Unpauses a container
• comment - Only present if the container can not be unpaused
salt.modules.dockermod.unpause(name) Unpauses a container
salt.modules.dockermod.version() Returns a dictionary of Docker version information. Equivalent to running the docker version Docker CLI command.
salt myminion docker.version
salt.modules.dockermod.volumes(filters=None) List existing volumes
filters There is one available filter: dangling=true
salt myminion docker.volumes filters="{'dangling': True}"
salt.modules.dockermod.wait(name, ignore_already_stopped=False, fail_on_exit_status=False) Wait for the container to exit gracefully, and return its exit code
NOTE: This function will block until the container is stopped.
ignore_already_stopped Boolean flag that prevents execution to fail, if a container is already stopped.
fail_on_exit_status Boolean flag to report execution as failure if exit_status is different than 0.
• exit_status - Exit status for the container
• comment - Only present if the container is already stopped
salt myminion docker.wait mycontainer
salt.modules.dpkg_lowpkg Support for DEB packages
salt.modules.dpkg_lowpkg.bin_pkg_info(path, saltenv='base') New in version 2015.8.0.
Parses RPM metadata and returns a dictionary of information about the package (name, version, etc.).
path   Path to the file. Can either be an absolute path to a file on the minion, or a salt fileserver URL (e.g. salt://path/to/file.rpm).  If a salt fileserver URL is passed, the file will be cached to the minion so that it can be examined.
saltenv base Salt fileserver environment from which to retrieve the package. Ignored if path is a local file path on the minion.
salt '*' lowpkg.bin_pkg_info /root/foo-1.2.3-1ubuntu1_all.deb salt '*' lowpkg.bin_pkg_info salt://foo-1.2.3-1ubuntu1_all.deb
salt.modules.dpkg_lowpkg.file_dict(*packages, **kwargs) 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 package database (not generally recommended).
salt '*' lowpkg.file_dict hostname salt '*' lowpkg.file_dict hostname mount salt '*' lowpkg.file_dict
salt.modules.dpkg_lowpkg.file_list(*packages, **kwargs) List the files that belong to a package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended).
salt '*' lowpkg.file_list hostname salt '*' lowpkg.file_list hostname mount salt '*' lowpkg.file_list
salt.modules.dpkg_lowpkg.info(*packages, **kwargs) Returns a detailed summary of package information for provided package names.  If no packages are specified, all packages will be returned.
packages The names of the packages for which to return information.
salt '*' lowpkg.info salt '*' lowpkg.info apache2 bash salt '*' lowpkg.info 'php5*' failhard=false
salt.modules.dpkg_lowpkg.list_pkgs(*packages, **kwargs) List the packages currently installed in a dict:
External dependencies:
Virtual package resolution requires aptitude. Because this function uses dpkg, virtual packages will be reported as not installed.
salt '*' lowpkg.list_pkgs salt '*' lowpkg.list_pkgs hostname salt '*' lowpkg.list_pkgs hostname mount
salt.modules.dpkg_lowpkg.unpurge(*packages) Change package selection for each package specified to 'install'
salt '*' lowpkg.unpurge curl
salt.modules.drac Manage Dell DRAC
salt.modules.drac.change_password(username, password, uid=None) Change users password
salt dell drac.change_password [USERNAME] [PASSWORD] [UID - optional] salt dell drac.change_password diana secret
salt.modules.drac.create_user(username, password, permissions, users=None) Create user accounts
salt dell drac.create_user [USERNAME] [PASSWORD] [PRIVILEGES] salt dell drac.create_user diana secret login,test_alerts,clear_logs
DRAC Privileges
• login                   : Login to iDRAC
• drac                    : Configure iDRAC
• user_management         : Configure Users
• clear_logs              : Clear Logs
• server_control_commands : Execute Server Control Commands
• console_redirection     : Access Console Redirection
• virtual_media           : Access Virtual Media
• test_alerts             : Test Alerts
• debug_commands          : Execute Debug Commands
salt.modules.drac.delete_user(username, uid=None) Delete a user
salt dell drac.delete_user [USERNAME] [UID - optional] salt dell drac.delete_user diana 4
salt.modules.drac.email_alerts(action) Enable/Disable email alerts
salt dell drac.email_alerts True salt dell drac.email_alerts False
salt.modules.drac.list_users() List all DRAC users
salt dell drac.list_users
salt.modules.drac.nameservers(*ns) Configure the nameservers on the DRAC
salt dell drac.nameservers [NAMESERVERS] salt dell drac.nameservers ns1.example.com ns2.example.com
salt.modules.drac.network_info() Return Network Configuration
salt dell drac.network_info
salt.modules.drac.server_hardreset() Performs a reset (reboot) operation on the managed server.
salt dell drac.server_hardreset
salt.modules.drac.server_poweroff() Powers down the managed server.
salt dell drac.server_poweroff
salt.modules.drac.server_poweron() Powers up the managed server.
salt dell drac.server_poweron
salt.modules.drac.server_pxe() Configure server to PXE perform a one off PXE boot
salt dell drac.server_pxe
salt.modules.drac.server_reboot() Issues a power-cycle operation on the managed server. This action is similar to pressing the power button on the system's front panel to power down and then power up the system.
salt dell drac.server_reboot
salt.modules.drac.set_network(ip, netmask, gateway) Configure Network
salt dell drac.set_network [DRAC IP] [NETMASK] [GATEWAY] salt dell drac.set_network 192.168.0.2 255.255.255.0 192.168.0.1
salt.modules.drac.set_permissions(username, permissions, uid=None) Configure users permissions
salt dell drac.set_permissions [USERNAME] [PRIVILEGES] [USER INDEX - optional] salt dell drac.set_permissions diana login,test_alerts,clear_logs 4
salt.modules.drac.set_snmp(community) Configure SNMP community string
salt dell drac.set_snmp [COMMUNITY] salt dell drac.set_snmp public
salt.modules.drac.syslog(server, enable=True) Configure syslog remote logging, by default syslog will automatically be enabled if a server is specified. However, if you want to disable syslog you will need to specify a server followed by False
salt dell drac.syslog [SYSLOG IP] [ENABLE/DISABLE] salt dell drac.syslog 0.0.0.0 False
salt.modules.drac.system_info() Return System information
salt dell drac.system_info
salt.modules.dracr Manage Dell DRAC.
salt.modules.dracr.bare_rac_cmd(cmd, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.change_password(username, password, uid=None, host=None, admin_username=None, admin_password=None, module=None) Change user's password
salt dell dracr.change_password [USERNAME] [PASSWORD] uid=[OPTIONAL] host=<remote DRAC> admin_username=<DRAC user> admin_password=<DRAC PW> salt dell dracr.change_password diana secret
Note that if only a username is specified then this module will look up details for all 16 possible DRAC users.  This is time consuming, but might be necessary if one is not sure which user slot contains the one you want.  Many late-model Dell chassis have 'root' as UID 1, so if you can depend on that then setting the password is much quicker.  Raises an error if the supplied password is greater than 20 chars.
salt.modules.dracr.create_user(username, password, permissions, users=None, host=None, admin_username=None, admin_password=None) Create user accounts
salt dell dracr.create_user [USERNAME] [PASSWORD] [PRIVILEGES] salt dell dracr.create_user diana secret login,test_alerts,clear_logs
salt.modules.dracr.delete_user(username, uid=None, host=None, admin_username=None, admin_password=None) Delete a user
salt dell dracr.delete_user [USERNAME] [UID - optional] salt dell dracr.delete_user diana 4
salt.modules.dracr.deploy_password(username, password, host=None, admin_username=None, admin_password=None, module=None) Change the QuickDeploy password, used for switches as well
salt dell dracr.deploy_password [USERNAME] [PASSWORD] host=<remote DRAC> admin_username=<DRAC user> admin_password=<DRAC PW> salt dell dracr.change_password diana secret
Note that if only a username is specified then this module will look up details for all 16 possible DRAC users.  This is time consuming, but might be necessary if one is not sure which user slot contains the one you want.  Many late-model Dell chassis have 'root' as UID 1, so if you can depend on that then setting the password is much quicker.
salt.modules.dracr.deploy_snmp(snmp, host=None, admin_username=None, admin_password=None, module=None) Change the QuickDeploy SNMP community string, used for switches as well
salt dell dracr.deploy_snmp SNMP_STRING host=<remote DRAC or CMC> admin_username=<DRAC user> admin_password=<DRAC PW> salt dell dracr.deploy_password diana secret
salt.modules.dracr.email_alerts(action, host=None, admin_username=None, admin_password=None) Enable/Disable email alerts
salt dell dracr.email_alerts True salt dell dracr.email_alerts False
salt.modules.dracr.get_chassis_datacenter(host=None, admin_username=None, admin_password=None) Get the datacenter of the chassis.
host   The chassis host.
admin_username The username used to access the chassis.
admin_password The password used to access the chassis.
salt '*' dracr.set_chassis_location host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.get_chassis_location(host=None, admin_username=None, admin_password=None) Get the location of the chassis.
salt.modules.dracr.get_chassis_name(host=None, admin_username=None, admin_password=None) Get the name of a chassis.
salt '*' dracr.get_chassis_name host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.get_dns_dracname(host=None, admin_username=None, admin_password=None)
salt.modules.dracr.get_general(cfg_sec, cfg_var, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.get_slotname(slot, host=None, admin_username=None, admin_password=None) Get the name of a slot number in the chassis.
slot   The number of the slot for which to obtain the name.
salt-call --local dracr.get_slotname 0 host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.idrac_general(blade_name, command, idrac_password=None, host=None, admin_username=None, admin_password=None) Run a generic racadm command against a particular blade in a chassis.  Blades are usually named things like 'server-1', 'server-2', etc.  If the iDRAC has a different password than the CMC, then you can pass it with the idrac_password kwarg.
• blade_name -- Name of the blade to run the command on
• command -- Command like to pass to racadm
• idrac_password -- Password for the iDRAC if different from the CMC
• host -- Chassis hostname
• admin_username -- CMC username
• admin_password -- CMC password
Returns stdout if the retcode is 0, otherwise a standard cmd.run_all dictionary
salt fx2 chassis.cmd idrac_general server-1 'get BIOS.SysProfileSettings'
salt.modules.dracr.inventory(host=None, admin_username=None, admin_password=None)
salt.modules.dracr.list_slotnames(host=None, admin_username=None, admin_password=None) List the names of all slots in the chassis.
salt-call --local dracr.list_slotnames host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.list_users(host=None, admin_username=None, admin_password=None, module=None) List all DRAC users
salt dell dracr.list_users
salt.modules.dracr.nameservers(ns, host=None, admin_username=None, admin_password=None, module=None) Configure the nameservers on the DRAC
salt dell dracr.nameservers [NAMESERVERS] salt dell dracr.nameservers ns1.example.com ns2.example.com admin_username=root admin_password=calvin module=server-1 host=192.168.1.1
salt.modules.dracr.network_info(host=None, admin_username=None, admin_password=None, module=None) Return Network Configuration
salt dell dracr.network_info
salt.modules.dracr.server_hardreset(host=None, admin_username=None, admin_password=None, module=None) Performs a reset (reboot) operation on the managed server.
module The element to hard reset on the chassis such as a blade. If not provided, the chassis will be reset.
salt dell dracr.server_hardreset salt dell dracr.server_hardreset module=server-1
salt.modules.dracr.server_power(status, host=None, admin_username=None, admin_password=None, module=None)
status One of 'powerup', 'powerdown', 'powercycle', 'hardreset', 'graceshutdown'
module The element to reboot on the chassis such as a blade. If not provided, the chassis will be rebooted.
salt dell dracr.server_reboot salt dell dracr.server_reboot module=server-1
salt.modules.dracr.server_poweroff(host=None, admin_username=None, admin_password=None, module=None) Powers down the managed server.
module The element to power off on the chassis such as a blade. If not provided, the chassis will be powered off.
salt dell dracr.server_poweroff salt dell dracr.server_poweroff module=server-1
salt.modules.dracr.server_poweron(host=None, admin_username=None, admin_password=None, module=None) Powers up the managed server.
module The element to power on located on the chassis such as a blade. If not provided, the chassis will be powered on.
salt dell dracr.server_poweron salt dell dracr.server_poweron module=server-1
salt.modules.dracr.server_powerstatus(host=None, admin_username=None, admin_password=None, module=None) return the power status for the passed module
salt dell drac.server_powerstatus
salt.modules.dracr.server_pxe(host=None, admin_username=None, admin_password=None) Configure server to PXE perform a one off PXE boot
salt dell dracr.server_pxe
salt.modules.dracr.server_reboot(host=None, admin_username=None, admin_password=None, module=None) Issues a power-cycle operation on the managed server. This action is similar to pressing the power button on the system's front panel to power down and then power up the system.
salt.modules.dracr.set_chassis_datacenter(location, host=None, admin_username=None, admin_password=None) Set the location of the chassis.
location The name of the datacenter to be set on the chassis.
salt '*' dracr.set_chassis_datacenter datacenter-name host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.set_chassis_location(location, host=None, admin_username=None, admin_password=None) Set the location of the chassis.
location The name of the location to be set on the chassis.
salt '*' dracr.set_chassis_location location-name host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.set_chassis_name(name, host=None, admin_username=None, admin_password=None) Set the name of the chassis.
name   The name to be set on the chassis.
salt '*' dracr.set_chassis_name my-chassis host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.set_dns_dracname(name, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.set_general(cfg_sec, cfg_var, val, host=None, admin_username=None, admin_password=None)
salt.modules.dracr.set_network(ip, netmask, gateway, host=None, admin_username=None, admin_password=None) Configure Network on the CMC or individual iDRAC.  Use set_niccfg for blade and switch addresses.
salt dell dracr.set_network [DRAC IP] [NETMASK] [GATEWAY] salt dell dracr.set_network 192.168.0.2 255.255.255.0 192.168.0.1 admin_username=root admin_password=calvin host=192.168.1.1
salt.modules.dracr.set_niccfg(ip=None, netmask=None, gateway=None, dhcp=False, host=None, admin_username=None, admin_password=None, module=None)
salt.modules.dracr.set_nicvlan(vlan=None, host=None, admin_username=None, admin_password=None, module=None)
salt.modules.dracr.set_permissions(username, permissions, uid=None, host=None, admin_username=None, admin_password=None) Configure users permissions
salt dell dracr.set_permissions [USERNAME] [PRIVILEGES] [USER INDEX - optional] salt dell dracr.set_permissions diana login,test_alerts,clear_logs 4
salt.modules.dracr.set_slotname(slot, name, host=None, admin_username=None, admin_password=None) Set the name of a slot in a chassis.
slot   The slot number to change.
name   The name to set. Can only be 15 characters long.
salt '*' dracr.set_slotname 2 my-slotname host=111.222.333.444 admin_username=root admin_password=secret
salt.modules.dracr.set_snmp(community, host=None, admin_username=None, admin_password=None) Configure CMC or individual iDRAC SNMP community string.  Use deploy_snmp for configuring chassis switch SNMP.
salt dell dracr.set_snmp [COMMUNITY] salt dell dracr.set_snmp public
salt.modules.dracr.syslog(server, enable=True, host=None, admin_username=None, admin_password=None, module=None) Configure syslog remote logging, by default syslog will automatically be enabled if a server is specified. However, if you want to disable syslog you will need to specify a server followed by False
salt dell dracr.syslog [SYSLOG IP] [ENABLE/DISABLE] salt dell dracr.syslog 0.0.0.0 False
salt.modules.dracr.system_info(host=None, admin_username=None, admin_password=None, module=None) Return System information
salt dell dracr.system_info
salt.modules.dracr.update_firmware(filename, host=None, admin_username=None, admin_password=None) Updates firmware using local firmware file
salt dell dracr.update_firmware firmware.exe
This executes the following command on your FX2 (using username and password stored in the pillar data)
racadm update –f firmware.exe -u user –p pass
salt.modules.dracr.update_firmware_nfs_or_cifs(filename, share, host=None, admin_username=None, admin_password=None) Executes the following for CIFS (using username and password stored in the pillar data)
racadm update -f <updatefile> -u user –p pass -l //IP-Address/share
Or for NFS (using username and password stored in the pillar data)
racadm update -f <updatefile> -u user –p pass -l IP-address:/share
Salt command for CIFS:
salt dell dracr.update_firmware_nfs_or_cifs          firmware.exe //IP-Address/share
Salt command for NFS:
salt dell dracr.update_firmware_nfs_or_cifs          firmware.exe IP-address:/share
salt.modules.drbd DRBD administration module
salt.modules.drbd.overview() Show status of the DRBD devices, support two nodes only. drbd-overview is removed since drbd-utils-9.6.0, use status instead.
salt '*' drbd.overview
salt.modules.drbd.status(name='all') Using drbdadm to show status of the DRBD devices, available in the latest drbd9.  Support multiple nodes, multiple volumes.
Parameters name (str) -- Resource name.
Returns drbd status of resource.
Return type list(dict(res))
salt '*' drbd.status salt '*' drbd.status name=<resource name>
salt.modules.dummyproxy_pkg Package support for the dummy proxy used by the test suite
salt.modules.dummyproxy_pkg.install(name=None, refresh=False, fromrepo=None, pkgs=None, sources=None, **kwargs)
salt.modules.dummyproxy_pkg.installed(name, version=None, refresh=False, fromrepo=None, skip_verify=False, pkgs=None, sources=None, **kwargs)
salt.modules.dummyproxy_pkg.list_pkgs(versions_as_list=False, **kwargs)
salt.modules.dummyproxy_pkg.remove(name=None, pkgs=None, **kwargs)
salt.modules.dummyproxy_pkg.upgrade(name=None, pkgs=None, refresh=True, skip_verify=True, normalize=True, **kwargs)
salt.modules.dummyproxy_pkg.version(*names, **kwargs) 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.
salt.modules.dummyproxy_service Provide the service module for the dummy proxy used in integration tests
salt.modules.dummyproxy_service.enabled(name, sig=None) Only the 'redbull' service is 'enabled' in the test
salt.modules.dummyproxy_service.get_all() Return a list of all available services
salt.modules.dummyproxy_service.list_() Return a list of all available services.
salt '*' service.list
salt.modules.dummyproxy_service.restart(name, sig=None) Restart the specified service with dummy.
salt.modules.dummyproxy_service.running(name, sig=None) Return whether this service is running.
salt.modules.dummyproxy_service.start(name, sig=None) Start the specified service on the dummy
salt.modules.dummyproxy_service.status(name, sig=None) Return the status for a service via dummy, returns a bool whether the service is running.
salt '*' service.status <service name>
salt.modules.dummyproxy_service.stop(name, sig=None) Stop the specified service on the dummy
salt.modules.ebuildpkg Support for Portage
• portage Python adapter
For now all package names MUST include the package category, i.e. 'vim' will not work, 'app-editors/vim' will.
salt.modules.ebuildpkg.available_version(*names, **kwargs) This function is an alias of 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.
salt.modules.ebuildpkg.check_db(*names, **kwargs) 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. This list will be empty if the package name was specified in category/pkgname format, since the suggestions are only intended to disambiguate ambiguous package names (ones submitted without a category).
salt '*' pkg.check_db <package1> <package2> <package3>
salt.modules.ebuildpkg.check_extra_requirements(pkgname, pkgver) Check if the installed package already has the given requirements.
salt '*' pkg.check_extra_requirements 'sys-devel/gcc' '~>4.1.2:4.1::gentoo[nls,fortran]'
salt.modules.ebuildpkg.depclean(name=None, slot=None, fromrepo=None, pkgs=None) Portage has a function to remove unused dependencies. If a package is provided, it will only removed the package if no other package depends on it.
name   The name of the package to be cleaned.
slot   Restrict the remove to a specific slot. Ignored if name is None.
fromrepo Restrict the remove to a specific slot. Ignored if name is None.
pkgs   Clean multiple packages. slot and fromrepo arguments are ignored if this argument is present. Must be passed as a python list.
Return a list containing the removed packages:
salt '*' pkg.depclean <package name>
salt.modules.ebuildpkg.ex_mod_init(low) If the config option ebuild.enforce_nice_config is set to True, this module will enforce a nice tree structure for /etc/portage/package.*  configuration files.
New in version 0.17.0: Initial automatic enforcement added when pkg is used on a Gentoo system.
Changed in version 2014.7.0: Configure option added to make this behaviour optional, defaulting to off.
SEE ALSO: ebuild.ex_mod_init is called automatically when a state invokes a pkg state on a Gentoo system.  salt.states.pkg.mod_init()
ebuild.ex_mod_init uses portage_config.enforce_nice_config to do the lifting. salt.modules.portage_config.enforce_nice_config()
salt '*' pkg.ex_mod_init
salt.modules.ebuildpkg.install(name=None, refresh=False, pkgs=None, sources=None, slot=None, fromrepo=None, uses=None, binhost=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any emerge commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Install the passed package(s), add refresh=True to sync the portage tree 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 emerge a package from the portage tree. To install a tbz2 package manually, use the "sources" option described below.
refresh Whether or not to sync the portage tree before installing.
version Install a specific version of the package, e.g. 1.0.9-r1. Ignored if "pkgs" or "sources" is passed.
slot   Similar to version, but specifies a valid slot to be installed. It will install the latest available version in the specified slot.  Ignored if "pkgs" or "sources" or "version" is passed.
salt '*' pkg.install sys-devel/gcc slot='4.4'
fromrepo Similar to slot, but specifies the repository from the package will be installed. It will install the latest available version in the specified repository.  Ignored if "pkgs" or "sources" or "version" is passed.
salt '*' pkg.install salt fromrepo='gentoo'
uses   Similar to slot, but specifies a list of use flag.  Ignored if "pkgs" or "sources" or "version" is passed.
salt '*' pkg.install sys-devel/gcc uses='["nptl","-nossp"]'
pkgs   A list of packages to install from the portage tree. Must be passed as a python list.
salt '*' pkg.install pkgs='["foo","bar","~category/package:slot::repository[use]"]'
sources A list of tbz2 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.
salt '*' pkg.install sources='[{"foo": "salt://foo.tbz2"},{"bar": "salt://bar.tbz2"}]'
binhost has two options try and force.  try - tells emerge to try and install the package from a configured binhost.  force - forces emerge to install the package from a binhost otherwise it fails out.
salt.modules.ebuildpkg.latest_version(*names, **kwargs) 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.
salt.modules.ebuildpkg.list_pkgs(versions_as_list=False, **kwargs) List the packages currently installed in a dict:
salt.modules.ebuildpkg.list_upgrades(refresh=True, backtrack=3, **kwargs) List all available package upgrades.
refresh Whether or not to sync the portage tree before checking for upgrades.
backtrack Specifies an integer number of times to backtrack if dependency calculation fails due to a conflict or an unsatisfied dependency (default: ´3´).
salt.modules.ebuildpkg.porttree_matches(name) Returns a list containing the matches for a given package name from the portage tree. Note that the specific version of the package will not be provided for packages that have several versions in the portage tree, but rather the name of the package (i.e. "dev-python/paramiko").
salt.modules.ebuildpkg.purge(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any emerge commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Portage does not have a purge, this function calls remove followed by depclean to emulate a purge process
pkgs   Uninstall multiple packages. slot and fromrepo arguments are ignored if this argument is present. Must be passed as a python list.
salt '*' pkg.purge <package name> salt '*' pkg.purge <package name> slot=4.4 salt '*' pkg.purge <package1>,<package2>,<package3> salt '*' pkg.purge pkgs='["foo", "bar"]'
salt.modules.ebuildpkg.refresh_db(**kwargs) Update the portage tree using the first available method from the following list:
• emaint sync
• eix-sync
• emerge-webrsync
• emerge --sync
To prevent the portage tree from being synced within one day of the previous sync, add the following pillar data for this minion:
portage: sync_wait_one_day: True
salt.modules.ebuildpkg.remove(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any emerge commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Remove packages via emerge --unmerge.
salt '*' pkg.remove <package name> salt '*' pkg.remove <package name> slot=4.4 fromrepo=gentoo salt '*' pkg.remove <package1>,<package2>,<package3> salt '*' pkg.remove pkgs='["foo", "bar"]'
salt.modules.ebuildpkg.update(pkg, slot=None, fromrepo=None, refresh=False, binhost=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any emerge commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Updates the passed package (emerge --update package)
slot   Restrict the update to a particular slot. It will update to the latest version within the slot.
fromrepo Restrict the update to a particular repository. It will update to the latest version within the repository.
Return a dict containing the new package names and versions:
salt '*' pkg.update <package name>