neulab/tldr huggingface dataset:
salt '*' jboss7_cli.run_command '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' my_command
salt.modules.jboss7_cli.run_operation(jboss_config, operation, fail_on_error=True, retries=1) Execute an operation against jboss instance through the CLI interface.
operation An operation to execute against jboss instance
retries: Number of retries in case of "JBAS012144: Could not connect to remote" error.
salt '*' jboss7_cli.run_operation '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' my_operation
salt.modules.jenkinsmod Module for controlling Jenkins
depends python-jenkins
depends python-jenkins Python module (not to be confused with jenkins)
configuration This module can be used by either passing an api key and version directly or by specifying both in a configuration profile in the salt master/minion config.
jenkins: api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15
salt.modules.jenkinsmod.build_job(name=None, parameters=None) Initiate a build for the provided job.
• name -- The name of the job is check if it exists.
• parameters -- Parameters to send to the job.
Returns True is successful, otherwise raise an exception.
salt '*' jenkins.build_job jobname
salt.modules.jenkinsmod.create_job(name=None, config_xml=None, saltenv='base') Return the configuration file.
• config_xml -- The configuration file to use to create the job.
• saltenv -- The environment to look for the file in.
Returns The configuration file used for the job.
salt '*' jenkins.create_job jobname
salt '*' jenkins.create_job jobname config_xml='salt://jenkins/config.xml'
salt.modules.jenkinsmod.delete_job(name=None) Return true is job is deleted successfully.
Parameters name -- The name of the job to delete.
Returns Return true if job is deleted successfully.
salt '*' jenkins.delete_job jobname
salt.modules.jenkinsmod.disable_job(name=None) Return true is job is disabled successfully.
Parameters name -- The name of the job to disable.
Returns Return true if job is disabled successfully.
salt '*' jenkins.disable_job jobname
salt.modules.jenkinsmod.enable_job(name=None) Return true is job is enabled successfully.
Parameters name -- The name of the job to enable.
Returns Return true if job is enabled successfully.
salt '*' jenkins.enable_job jobname
salt.modules.jenkinsmod.get_job_config(name=None) Return the current job configuration for the provided job.
Parameters name -- The name of the job to return the configuration for.
Returns The configuration for the job specified.
salt '*' jenkins.get_job_config jobname
salt.modules.jenkinsmod.get_job_info(name=None) Return information about the Jenkins job.
Parameters name -- The name of the job is check if it exists.
Returns Information about the Jenkins job.
salt '*' jenkins.get_job_info jobname
salt.modules.jenkinsmod.get_jobs() Return the currently configured jobs.
Returns The currently configured jobs.
salt '*' jenkins.get_jobs
salt.modules.jenkinsmod.get_version() Return version of Jenkins
Returns The version of Jenkins
salt '*' jenkins.get_version
salt.modules.jenkinsmod.job_exists(name=None) Check whether the job exists in configured Jenkins jobs.
Returns True if job exists, False if job does not exist.
salt '*' jenkins.job_exists jobname
salt.modules.jenkinsmod.job_status(name=None) Return the current status, enabled or disabled, of the job.
Parameters name -- The name of the job to return status for
Returns Return true if enabled or false if disabled.
salt '*' jenkins.job_status jobname
salt.modules.jenkinsmod.plugin_installed(name) New in version 2016.11.0.
Return if the plugin is installed for the provided plugin name.
Parameters name -- The name of the parameter to confirm installation.
Returns True if plugin exists, False if plugin does not exist.
salt '*' jenkins.plugin_installed pluginName
salt.modules.jenkinsmod.run(script) New in version 2017.7.0.
Execute a script on the jenkins master
Parameters script -- The script
salt '*' jenkins.run 'Jenkins.instance.doSafeRestart()'
salt.modules.jenkinsmod.update_job(name=None, config_xml=None, saltenv='base') Return the updated configuration file.
salt '*' jenkins.update_job jobname
salt '*' jenkins.update_job jobname config_xml='salt://jenkins/config.xml'
salt.modules.jinja Module for checking jinja maps and verifying the result of loading JSON/YAML files
salt.modules.jinja.import_json(path) Loads JSON data from the specified path
salt myminion jinja.import_JSON myformula/foo.json
salt.modules.jinja.import_yaml(path) Loads YAML data from the specified path
salt myminion jinja.import_yaml myformula/foo.yaml
salt.modules.jinja.load_map(path, value) Loads the map at the specified path, and returns the specified value from that map.
# Assuming the map is loaded in your formula SLS as follows: # # {% from "myformula/map.jinja" import myformula with context %} # # the following syntax can be used to load the map and check the # results: salt myminion jinja.load_map myformula/map.jinja myformula
salt.modules.jira_mod JIRA Execution module New in version 2019.2.0.
Execution module to manipulate JIRA tickets via Salt.
This module requires the jira Python library to be installed.
jira: server: https://jira.atlassian.org username: salt password: pass
salt.modules.jira_mod.add_comment(issue_key, comment, visibility=None, is_internal=False, server=None, username=None, password=None) Add a comment to an existing ticket. Return True when it successfully added the comment.
issue_key The issue ID to add the comment to.
comment The body of the comment to be added.
visibility: None A dictionary having two keys:
• type: is role (or group if the JIRA server has configured comment visibility for groups).
• value: the name of the role (or group) to which viewing of this comment will be restricted.
is_internal: False Whether a comment has to be marked as Internal in Jira Service Desk.
salt '*' jira.add_comment NE-123 'This is a comment'
salt.modules.jira_mod.assign_issue(issue_key, assignee, server=None, username=None, password=None) Assign the issue to an existing user. Return True when the issue has been properly assigned.
issue_key The JIRA ID of the ticket to manipulate.
assignee The name of the user to assign the ticket to.
salt '*' jira.assign_issue NET-123 example_user
salt.modules.jira_mod.create_issue(project, summary, description, template_engine='jinja', context=None, defaults=None, saltenv='base', issuetype='Bug', priority='Normal', labels=None, assignee=None, server=None, username=None, password=None, **kwargs) Create a JIRA issue using the named settings. Return the JIRA ticket ID.
project The name of the project to attach the JIRA ticket to.
summary The summary (title) of the JIRA ticket. When the template_engine argument is set to a proper value of an existing Salt template engine (e.g., jinja, mako, etc.) it will render the summary before creating the ticket.
description The full body description of the JIRA ticket. When the template_engine argument is set to a proper value of an existing Salt template engine (e.g., jinja, mako, etc.) it will render the description before creating the ticket.
template_engine: jinja The name of the template engine to be used to render the values of the summary and description arguments. Default: jinja.
context: None The context to pass when rendering the summary and description.  This argument is ignored when template_engine is set as None
defaults: None Default values to pass to the Salt rendering pipeline for the summary and description arguments.  This argument is ignored when template_engine is set as None.
saltenv: base The Salt environment name (for the rendering system).
issuetype: Bug The type of the JIRA ticket. Default: Bug.
priority: Normal The priority of the JIRA ticket. Default: Normal.
labels: None A list of labels to add to the ticket.
assignee: None The name of the person to assign the ticket to.
salt '*' jira.create_issue NET 'Ticket title' 'Ticket description' salt '*' jira.create_issue NET 'Issue on {{ opts.id }}' 'Error detected on {{ opts.id }}' template_engine=jinja
salt.modules.jira_mod.issue_closed(issue_key, server=None, username=None, password=None) Check if the issue is closed.
issue_key The JIRA iD of the ticket to close.
• True: the ticket exists and it is closed.
• False: the ticket exists and it has not been closed.
• None: the ticket does not exist.
salt '*' jira.issue_closed NE-123
salt.modules.junos Module to interact with Junos devices.
dependencies junos-eznc, jxmlease
NOTE: Those who wish to use junos-eznc (PyEZ) version >= 2.1.0, must use the latest salt code from github until the next release.
Refer to junos for information on connecting to junos proxy.
class salt.modules.junos.HandleFileCopy(path, **kwargs) To figure out proper path either from proxy local file system or proxy cache or on master. If required, then only copy from master to proxy
salt.modules.junos.cli(command=None, **kwargs) Executes the CLI commands and returns the output in specified format.     (default is text) The output can also be stored in a file.
command (required) The command to execute on the Junos CLI
format text Format in which to get the CLI output (either text or xml)
dev_timeout 30 The NETCONF RPC timeout (in seconds)
dest   Destination file where the RPC output is stored. Note that the file will be stored on the proxy minion. To push the files to the master use cp.push.
salt 'device_name' junos.cli 'show system commit' salt 'device_name' junos.cli 'show system alarms' format=xml dest=/home/user/cli_output.txt
salt.modules.junos.commit(**kwargs) To commit the changes loaded in the candidate configuration.
comment Provide a comment for the commit
confirm Provide time in minutes for commit confirmation. If this option is specified, the commit will be rolled back in the specified amount of time unless the commit is confirmed.
sync   False When True, on dual control plane systems, requests that the candidate configuration on one control plane be copied to the other control plane, checked for correct syntax, and committed on both Routing Engines.
force_sync False When True, on dual control plane systems, force the candidate configuration on one control plane to be copied to the other control plane.
full   When True, requires all the daemons to check and evaluate the new configuration.
detail When True, return commit detail
salt 'device_name' junos.commit comment='Commiting via saltstack' detail=True salt 'device_name' junos.commit dev_timeout=60 confirm=10 salt 'device_name' junos.commit sync=True dev_timeout=90
salt.modules.junos.commit_check() Perform a commit check on the configuration
salt 'device_name' junos.commit_check
salt.modules.junos.diff(**kwargs) Returns the difference between the candidate and the current configuration
id     0 The rollback ID value (0-49)
d_id   0 The rollback ID value (0-49)
salt 'device_name' junos.diff d_id=3
NOTE: Because of historical reasons and the internals of the Salt state compiler, there are three possible sources of the rollback ID--the positional argument, and the id and d_id kwargs.  The precedence of the arguments are id (positional), id (kwarg), d_id (kwarg).  In other words, if all three are passed, only the positional argument will be used.  A warning is logged if more than one is passed.
salt.modules.junos.dir_copy(source, dest, force=False, **kwargs) Copy a directory and recursively its contents from source to dest.
NOTE: This function only works on the Juniper native minion
source : Directory to use as the source
dest : Directory in which to place the source and its contents.
force : This function will not copy identical files unless force is True
salt 'device_name' junos.dir_copy /etc/salt/pki re1:/
This will take the pki directory, its absolute path and copy it and its contents to routing engine 1 root directory. The result will be re1:/etc/salt/pki/<files and dirs in /etc/salt/pki.
salt.modules.junos.facts() Displays the facts gathered during the connection.  These facts are also stored in Salt grains.
salt 'device_name' junos.facts
salt.modules.junos.facts_refresh() Reload the facts dictionary from the device. Usually only needed if, the device configuration is changed by some other actor.  This function will also refresh the facts stored in the salt grains.
salt 'device_name' junos.facts_refresh
salt.modules.junos.file_compare(file1, file2, **kwargs) Compare two files and return a dictionary indicating if they are different.
Dictionary includes success key.  If False, one or more files do not exist or some other error occurred.
Under the hood, this uses the junos CLI command file compare files ...
NOTE: This function only works on Juniper native minions
salt junos-router junos.file_compare /var/tmp/backup1/cmt.script /var/tmp/backup2/cmt.script
junos-router: identical: False success: True
salt.modules.junos.file_copy(src, dest) Copies the file from the local device to the junos device
NOTE: This function does not work on Juniper native minions
src    The source path where the file is kept.
dest   The destination path on the where the file will be copied
salt 'device_name' junos.file_copy /home/m2/info.txt info_copy.txt
salt.modules.junos.fsentry_exists(dir, **kwargs) Returns a dictionary indicating if dir refers to a file or a non-file (generally a directory) in the file system, or if there is no file by that name.
salt junos-router junos.fsentry_exists /var/log
junos-router: is_dir: True exists: True
salt.modules.junos.get_table(table, table_file, path=None, target=None, key=None, key_items=None, filters=None, table_args=None) New in version 3001.
Retrieve data from a Junos device using Tables/Views
table (required) Name of PyEZ Table
table_file (required) YAML file that has the table specified in table parameter
path:  Path of location of the YAML file.  defaults to op directory in jnpr.junos.op
target: if command need to run on FPC, can specify fpc target
key:   To overwrite key provided in YAML
key_items: To select only given key items
filters: To select only filter for the dictionary from columns
table_args: key/value pair which should render Jinja template command or are passed as args to rpc call in op table
salt 'device_name' junos.get_table RouteTable routes.yml salt 'device_name' junos.get_table EthPortTable ethport.yml table_args='{"interface_name": "ge-3/2/2"}' salt 'device_name' junos.get_table EthPortTable ethport.yml salt://tables
salt.modules.junos.install_config(path=None, **kwargs) Installs the given configuration file into the candidate configuration.  Commits the changes if the commit checks or throws an error.
path (required) Path where the configuration/template file is present. If the file has a .conf extension, the content is treated as text format. If the file has a .xml extension, the content is treated as XML format. If the file has a .set extension, the content is treated as Junos OS set commands.
mode   exclusive The mode in which the configuration is locked. Can be one of private, dynamic, batch, exclusive, ephemeral
dev_timeout 30 Set NETCONF RPC timeout. Can be used for commands which take a while to execute.
overwrite False Set to True if you want this file is to completely replace the configuration file. Sets action to override
NOTE: This option cannot be used if format is "set".
replace False Specify whether the configuration file uses replace: statements. If True, only those statements under the replace tag will be changed.
merge  False If set to True will set the load-config action to merge.  the default load-config action is 'replace' for xml/json/text config
format Determines the format of the contents
update False Compare a complete loaded configuration against the candidate configuration. For each hierarchy level or configuration object that is different in the two configurations, the version in the loaded configuration replaces the version in the candidate configuration. When the configuration is later committed, only system processes that are affected by the changed configuration elements parse the new configuration. This action is supported from PyEZ 2.1.
diffs_file Path to the file where the diff (difference in old configuration and the committed configuration) will be stored. Note that the file will be stored on the proxy minion. To push the files to the master use: py:func:cp.push <salt.modules.cp.push>.
template_vars Variables to be passed into the template processing engine in addition to those present in pillar, the minion configuration, grains, etc.  You may reference these variables in your template like so:
{{ template_vars["var_name"] }}
salt 'device_name' junos.install_config 'salt://production/network/routers/config.set' salt 'device_name' junos.install_config 'salt://templates/replace_config.conf' replace=True comment='Committed via SaltStack' salt 'device_name' junos.install_config 'salt://my_new_configuration.conf' dev_timeout=300 diffs_file='/salt/confs/old_config.conf' overwrite=True salt 'device_name' junos.install_config 'salt://syslog_template.conf' template_vars='{"syslog_host": "10.180.222.7"}'
salt.modules.junos.install_os(path=None, **kwargs) Installs the given image on the device. After the installation is complete the device is rebooted, if reboot=True is given as a keyworded argument.
path (required) Path where the image file is present on the proxy minion
remote_path /var/tmp If the value of path  is a file path on the local (Salt host's) filesystem, then the image is copied from the local filesystem to the :remote_path: directory on the target Junos device. The default is /var/tmp. If the value of :path: or is a URL, then the value of :remote_path: is unused.
dev_timeout 1800 The NETCONF RPC timeout (in seconds). This argument was added since most of the time the "package add" RPC takes a significant amount of time.  So this :timeout: value will be used in the context of the SW installation process.  Defaults to 30 minutes (30*60=1800 seconds)
timeout 1800 Alias to dev_timeout for backward compatibility
reboot False Whether to reboot after installation
no_copy False If True the software package will not be SCP’d to the device
bool validate: When True this method will perform a config validation against the new image
bool issu: False When True allows unified in-service software upgrade (ISSU) feature enables you to upgrade between two different Junos OS releases with no disruption on the control plane and with minimal disruption of traffic.
bool nssu: False When True allows nonstop software upgrade (NSSU) enables you to upgrade the software running on a Juniper Networks EX Series Virtual Chassis or a Juniper Networks EX Series Ethernet Switch with redundant Routing Engines with a single command and minimal disruption to network traffic.
bool all_re: True When True (default), executes the software install on all Routing Engines of the Junos device. When False, execute the software install only on the current Routing Engine.
NOTE: Any additional keyword arguments specified are passed down to PyEZ sw.install() as is.  Please refer to below URl for PyEZ sw.install() documentation: https://pyez.readthedocs.io/en/latest/jnpr.junos.utils.html#jnpr.junos.utils.sw.SW.install
salt 'device_name' junos.install_os 'salt://images/junos_image.tgz' reboot=True salt 'device_name' junos.install_os 'salt://junos_16_1.tgz' dev_timeout=300
salt.modules.junos.load(path=None, **kwargs) Loads the configuration from the file provided onto the device.
salt 'device_name' junos.load 'salt://production/network/routers/config.set'
salt 'device_name' junos.load 'salt://templates/replace_config.conf' replace=True
salt 'device_name' junos.load 'salt://my_new_configuration.conf' overwrite=True
salt 'device_name' junos.load 'salt://syslog_template.conf' template_vars='{"syslog_host": "10.180.222.7"}'
salt.modules.junos.lock() Attempts an exclusive lock on the candidate configuration. This is a non-blocking call.
NOTE: When locking, it is important to remember to call junos.unlock once finished. If locking during orchestration, remember to include a step in the orchestration job to unlock.
salt 'device_name' junos.lock
salt.modules.junos.ping(dest_ip=None, **kwargs) Send a ping RPC to a device
dest_ip The IP of the device to ping
rapid  False When True, executes ping at 100pps instead of 1pps
ttl    Maximum number of IP routers (IP hops) allowed between source and destination
routing_instance Name of the routing instance to use to send the ping
interface Interface used to send traffic
count  5 Number of packets to send
salt 'device_name' junos.ping '8.8.8.8' count=5 salt 'device_name' junos.ping '8.8.8.8' ttl=1 rapid=True
salt.modules.junos.rollback(**kwargs) Roll back the last committed configuration changes and commit
diffs_file Path to the file where the diff (difference in old configuration and the committed configuration) will be stored. Note that the file will be stored on the proxy minion. To push the files to the master use cp.push.
salt 'device_name' junos.rollback 10
salt.modules.junos.routing_engine(**kwargs) Returns a dictionary containing the routing engines on the device and their status (Master, Disabled, Backup).
Under the hood parses the result of show chassis routing-engine
salt junos-router junos.routing_engine
junos-router: backup: - re1: master: re0: success: True
Returns success: False if the device does not appear to have multiple routing engines.
salt.modules.junos.rpc(cmd=None, dest=None, **kwargs) This function executes the RPC provided as arguments on the junos device.  The returned data can be stored in a file.
cmd    The RPC to be executed
format xml The format in which the RPC reply is received from the device
filter Used with the get-config RPC to get specific configuration
terse  False Amount of information you want
interface_name Name of the interface to query
salt 'device' junos.rpc get_config dest=/var/log/config.txt format=text filter='<configuration><system/></configuration>' salt 'device' junos.rpc get-interface-information dest=/home/user/interface.xml interface_name='lo0' terse=True salt 'device' junos.rpc get-chassis-inventory
salt.modules.junos.rpc_file_list(path, **kwargs) Use the Junos RPC interface to get a list of files and return them as a structure dictionary.
salt junos-router junos.rpc_file_list /var/local/salt/etc
junos-router: files: directory: directory-name: /var/local/salt/etc file-information: |_ file-directory: file-name: pki |_ file-name: proxy |_ file-directory: file-name: proxy.d total-file-blocks: 10 total-files: 1 success: True
salt.modules.junos.set_hostname(hostname=None, **kwargs) Set the device's hostname
hostname The name to be set
comment Provide a comment to the commit
salt 'device_name' junos.set_hostname salt-device
salt.modules.junos.shutdown(**kwargs) Shut down (power off) or reboot a device running Junos OS. This includes all Routing Engines in a Virtual Chassis or a dual Routing Engine system.
NOTE: One of shutdown or reboot must be set to True or no action will be taken.
shutdown False Set this to True if you want to shutdown the machine. This is a safety mechanism so that the user does not accidentally shutdown the junos device.
reboot False If True, reboot instead of shutting down
at     Used when rebooting, to specify the date and time the reboot should take place. The value of this option must match the JunOS CLI reboot syntax.
in_min Used when shutting down. Specify the delay (in minutes) before the device will be shut down.
salt 'device_name' junos.shutdown reboot=True salt 'device_name' junos.shutdown shutdown=True in_min=10 salt 'device_name' junos.shutdown shutdown=True
salt.modules.junos.unlock() Unlocks the candidate configuration.
salt 'device_name' junos.unlock
salt.modules.junos.zeroize() Resets the device to default factory settings
NOTE: In case of non-root user, proxy_reconnect will not be able to re-connect to the device as zeroize will delete the local user's configuration.  For more details on zeroize functionality, please refer https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/request-system-zeroize.html
salt 'device_name' junos.zeroize
salt.modules.k8s Salt module to manage Kubernetes cluster
Roadmap:
• Add creation of K8S objects (pod, rc, service, ...)
• Add replace of K8S objects (pod, rc, service, ...)
• Add deletion of K8S objects (pod, rc, service, ...)
• Add rolling update
• Add (auto)scalling
salt.modules.k8s.create_namespace(name, apiserver_url=None) New in version 2016.3.0.
Create kubernetes namespace from the name, similar to the functionality added to kubectl since v.1.2.0: .. code-block:: bash kubectl create namespaces namespace-name
salt '*' k8s.create_namespace namespace_name
salt '*' k8s.create_namespace namespace_name http://kube-master.cluster.local
salt.modules.k8s.create_secret(namespace, name, sources, apiserver_url=None, force=False, update=False, saltenv='base') New in version 2016.3.0.
Create k8s secrets in the defined namespace from the list of files
salt '*' k8s.create_secret namespace_name secret_name sources
salt '*' k8s.create_secret namespace_name secret_name sources http://kube-master.cluster.local
sources are either dictionary of {name: path, name1: path} pairs or array of strings defining paths.
Example of paths array:
['/full/path/filename', "file:///full/path/filename", "salt://secret/storage/file.txt", "http://user:password@securesite.com/secret-file.json"]
Example of dictionaries:
{"nameit": '/full/path/fiename', name2: "salt://secret/storage/file.txt"}
optional parameters accepted:
update=[false] default value is false if set to false, and secret is already present on the cluster - warning will be returned and no changes to the secret will be done.  In case it is set to "true" and secret is present but data is differ - secret will be updated.
force=[true] default value is true if the to False, secret will not be created in case one of the files is not valid kubernetes secret. e.g. capital letters in secret name or _ in case force is set to True, wrong files will be skipped but secret will be created any way.
saltenv=['base'] default value is base in case 'salt://' path is used, this parameter can change the visibility of files
salt.modules.k8s.delete_secret(namespace, name, apiserver_url=None, force=True) New in version 2016.3.0.
Delete kubernetes secret in the defined namespace. Namespace is the mandatory parameter as well as name.
salt '*' k8s.delete_secret namespace_name secret_name
salt '*' k8s.delete_secret namespace_name secret_name http://kube-master.cluster.local
salt.modules.k8s.get_labels(node=None, apiserver_url=None) New in version 2016.3.0.
Get labels from the current node
salt '*' k8s.get_labels salt '*' k8s.get_labels kube-node.cluster.local http://kube-master.cluster.local
salt.modules.k8s.get_namespaces(namespace='', apiserver_url=None) New in version 2016.3.0.
Get one or all kubernetes namespaces.
If namespace parameter is omitted, all namespaces will be returned back to user, similar to following kubectl example:
kubectl get namespaces -o json
In case namespace is set by user, the output will be similar to the one from kubectl:
kubectl get namespaces namespace_name -o json
salt '*' k8s.get_namespaces salt '*' k8s.get_namespaces namespace_name http://kube-master.cluster.local
salt.modules.k8s.get_secrets(namespace, name='', apiserver_url=None, decode=False, brief=False) Get k8s namespaces
salt '*' k8s.get_secrets namespace_name salt '*' k8s.get_secrets namespace_name secret_name http://kube-master.cluster.local
salt.modules.k8s.label_absent(name, node=None, apiserver_url=None) New in version 2016.3.0.
Delete label to the current node
salt '*' k8s.label_absent hw/disktype salt '*' k8s.label_absent hw/disktype kube-node.cluster.local http://kube-master.cluster.local
salt.modules.k8s.label_folder_absent(name, node=None, apiserver_url=None) New in version 2016.3.0.
Delete label folder to the current node
salt '*' k8s.label_folder_absent hw salt '*' k8s.label_folder_absent hw/ kube-node.cluster.local http://kube-master.cluster.local
salt.modules.k8s.label_present(name, value, node=None, apiserver_url=None) New in version 2016.3.0.
Set label to the current node
salt '*' k8s.label_present hw/disktype ssd
salt '*' k8s.label_present hw/disktype ssd kube-node.cluster.local http://kube-master.cluster.local
salt.modules.k8s.update_secret(namespace, name, sources, apiserver_url=None, force=True, saltenv='base') New in version 2016.3.0.
alias to k8s.create_secret with update=true
salt '*' k8s.update_secret namespace_name secret_name sources [apiserver_url] [force=true] [update=false] [saltenv='base']
salt.modules.kapacitor Kapacitor execution module.
kapacitor.host: 'localhost' kapacitor.port: 9092
Also protocol and SSL settings could be configured:
kapacitor.unsafe_ssl: 'false' kapacitor.protocol: 'http'
salt.modules.kapacitor.define_task(name, tick_script, task_type='stream', database=None, retention_policy='default', dbrps=None) Define a task. Serves as both create/update.
name   Name of the task.
tick_script Path to the TICK script for the task. Can be a salt:// source.
task_type Task type. Defaults to 'stream'
dbrps  A list of databases and retention policies in "dbname"."rpname" format to fetch data from. For backward compatibility, the value of 'database' and 'retention_policy' will be merged as part of dbrps.
database Which database to fetch data from.
retention_policy Which retention policy to fetch data from. Defaults to 'default'.
salt '*' kapacitor.define_task cpu salt://kapacitor/cpu.tick database=telegraf
salt.modules.kapacitor.delete_task(name) Delete a kapacitor task.
name   Name of the task to delete.
salt '*' kapacitor.delete_task cpu
salt.modules.kapacitor.disable_task(name) Disable a kapacitor task.
name   Name of the task to disable.
salt '*' kapacitor.disable_task cpu
salt.modules.kapacitor.enable_task(name) Enable a kapacitor task.
name   Name of the task to enable.
salt '*' kapacitor.enable_task cpu
salt.modules.kapacitor.get_task(name) Get a dict of data on a task.
name   Name of the task to get information about.
salt '*' kapacitor.get_task cpu
salt.modules.kapacitor.version() Get the kapacitor version.
salt.modules.kerberos Manage Kerberos KDC
configuration In order to manage your KDC you will need to generate a keytab that can authenticate without requiring a password.
# ktadd -k /root/secure.keytab kadmin/admin kadmin/changepw
On the KDC minion you will need to add the following to the minion configuration file so Salt knows what keytab to use and what principal to authenticate as.
auth_keytab: /root/auth.keytab auth_principal: kadmin/admin
salt.modules.kerberos.create_keytab(name, keytab, enctypes=None) Create keytab
salt 'kdc.example.com' kerberos.create_keytab host/host1.example.com host1.example.com.keytab
salt.modules.kerberos.create_principal(name, enctypes=None) Create Principal
salt 'kdc.example.com' kerberos.create_principal host/example.com
salt.modules.kerberos.delete_principal(name) Delete Principal
salt 'kdc.example.com' kerberos.delete_principal host/example.com@EXAMPLE.COM
salt.modules.kerberos.get_policy(name) Get policy details
salt 'kdc.example.com' kerberos.get_policy my_policy
salt.modules.kerberos.get_principal(name) Get princial details
salt 'kdc.example.com' kerberos.get_principal root/admin
salt.modules.kerberos.get_privs() Current privileges
salt 'kdc.example.com' kerberos.get_privs
salt.modules.kerberos.list_policies() List policies
salt 'kdc.example.com' kerberos.list_policies
salt.modules.kerberos.list_principals() Get all principals
salt 'kde.example.com' kerberos.list_principals
salt.modules.kernelpkg_linux_apt Manage Linux kernel packages on APT-based systems
salt.modules.kernelpkg_linux_apt.active() Return the version of the running kernel.
salt '*' kernelpkg.active
salt.modules.kernelpkg_linux_apt.cleanup(keep_latest=True) Remove all unused kernel packages from the system.
keep_latest True In the event that the active kernel is not the latest one installed, setting this to True will retain the latest kernel package, in addition to the active one. If False, all kernel packages other than the active one will be removed.
salt '*' kernelpkg.cleanup
salt.modules.kernelpkg_linux_apt.latest_available() Return the version of the latest kernel from the package repositories.
salt '*' kernelpkg.latest_available
salt.modules.kernelpkg_linux_apt.latest_installed() Return the version of the latest installed kernel.
salt '*' kernelpkg.latest_installed
NOTE: This function may not return the same value as active() if a new kernel has been installed and the system has not yet been rebooted.  The needs_reboot() function exists to detect this condition.
salt.modules.kernelpkg_linux_apt.list_installed() Return a list of all installed kernels.
salt '*' kernelpkg.list_installed
salt.modules.kernelpkg_linux_apt.needs_reboot() Detect if a new kernel version has been installed but is not running.  Returns True if a new kernel is installed, False otherwise.
salt '*' kernelpkg.needs_reboot
salt.modules.kernelpkg_linux_apt.remove(release) Remove a specific version of the kernel.
release The release number of an installed kernel. This must be the entire release number as returned by list_installed(), not the package name.
salt '*' kernelpkg.remove 4.4.0-70-generic
salt.modules.kernelpkg_linux_apt.upgrade(reboot=False, at_time=None) Upgrade the kernel and optionally reboot the system.
reboot False Request a reboot if a new kernel is available.
at_time immediate Schedule the reboot at some point in the future. This argument is ignored if reboot=False. See reboot() for more details on this argument.
salt '*' kernelpkg.upgrade salt '*' kernelpkg.upgrade reboot=True at_time=1
NOTE: An immediate reboot often shuts down the system before the minion has a chance to return, resulting in errors. A minimal delay (1 minute) is useful to ensure the result is delivered to the master.
salt.modules.kernelpkg_linux_apt.upgrade_available() Detect if a new kernel version is available in the repositories. Returns True if a new kernel is available, False otherwise.
salt '*' kernelpkg.upgrade_available
salt.modules.kernelpkg_linux_yum Manage Linux kernel packages on YUM-based systems
salt.modules.kernelpkg_linux_yum.active() Return the version of the running kernel.
salt.modules.kernelpkg_linux_yum.cleanup(keep_latest=True) Remove all unused kernel packages from the system.
salt.modules.kernelpkg_linux_yum.latest_available() Return the version of the latest kernel from the package repositories.
salt.modules.kernelpkg_linux_yum.latest_installed() Return the version of the latest installed kernel.
salt.modules.kernelpkg_linux_yum.list_installed() Return a list of all installed kernels.
salt.modules.kernelpkg_linux_yum.needs_reboot() Detect if a new kernel version has been installed but is not running.  Returns True if a new kernel is installed, False otherwise.
salt.modules.kernelpkg_linux_yum.remove(release) Remove a specific version of the kernel.
salt '*' kernelpkg.remove 3.10.0-327.el7
salt.modules.kernelpkg_linux_yum.upgrade(reboot=False, at_time=None) Upgrade the kernel and optionally reboot the system.
salt.modules.kernelpkg_linux_yum.upgrade_available() Detect if a new kernel version is available in the repositories. Returns True if a new kernel is available, False otherwise.
salt.modules.key Functions to view the minion's public key information
salt.modules.key.finger(hash_type=None) Return the minion's public key fingerprint
hash_type The hash algorithm used to calculate the fingerprint
salt '*' key.finger
salt.modules.key.finger_master(hash_type=None) Return the fingerprint of the master's public key on the minion.
salt '*' key.finger_master
salt.modules.keyboard Module for managing keyboards on supported POSIX-like systems using systemd, or such as Redhat, Debian and Gentoo.
salt.modules.keyboard.get_sys() Get current system keyboard setting
salt '*' keyboard.get_sys
salt.modules.keyboard.get_x() Get current X keyboard setting
salt '*' keyboard.get_x
salt.modules.keyboard.set_sys(layout) Set current system keyboard setting
salt '*' keyboard.set_sys dvorak
salt.modules.keyboard.set_x(layout) Set current X keyboard setting
salt '*' keyboard.set_x dvorak
salt.modules.keystone Module for handling openstack keystone calls.
• keystoneclient Python adapter
configuration This module is not usable until the following are specified either in a pillar or in the minion's config file:
keystone.user: admin keystone.password: verybadpass keystone.tenant: admin keystone.tenant_id: f80919baedab48ec8931f200c65a50df keystone.auth_url: 'http://127.0.0.1:5000/v2.0/' keystone.verify_ssl: True
OR (for token based authentication)
keystone.token: 'ADMIN' keystone.endpoint: 'http://127.0.0.1:35357/v2.0'
If configuration for multiple openstack accounts is required, they can be set up as different configuration profiles. For example:
openstack1: keystone.user: admin keystone.password: verybadpass keystone.tenant: admin keystone.tenant_id: f80919baedab48ec8931f200c65a50df keystone.auth_url: 'http://127.0.0.1:5000/v2.0/' keystone.verify_ssl: True
openstack2: keystone.user: admin keystone.password: verybadpass keystone.tenant: admin keystone.tenant_id: f80919baedab48ec8931f200c65a50df keystone.auth_url: 'http://127.0.0.2:5000/v2.0/' keystone.verify_ssl: True
With this configuration in place, any of the keystone functions can make use of a configuration profile by declaring it explicitly.  For example:
salt '*' keystone.tenant_list profile=openstack1
salt.modules.keystone.api_version(profile=None, **connection_args) Returns the API version derived from endpoint's response.
salt '*' keystone.api_version
salt.modules.keystone.auth(profile=None, **connection_args) Set up keystone credentials. Only intended to be used within Keystone-enabled modules.
salt '*' keystone.auth
salt.modules.keystone.ec2_credentials_create(user_id=None, name=None, tenant_id=None, tenant=None, profile=None, **connection_args) Create EC2-compatible credentials for user per tenant
salt '*' keystone.ec2_credentials_create name=admin tenant=admin
salt '*' keystone.ec2_credentials_create         user_id=c965f79c4f864eaaa9c3b41904e67082         tenant_id=722787eb540849158668370dc627ec5f
salt.modules.keystone.ec2_credentials_delete(user_id=None, name=None, access_key=None, profile=None, **connection_args) Delete EC2-compatible credentials
salt '*' keystone.ec2_credentials_delete         860f8c2c38ca4fab989f9bc56a061a64 access_key=5f66d2f24f604b8bb9cd28886106f442
salt '*' keystone.ec2_credentials_delete name=admin         access_key=5f66d2f24f604b8bb9cd28886106f442
salt.modules.keystone.ec2_credentials_get(user_id=None, name=None, access=None, profile=None, **connection_args) Return ec2_credentials for a user (keystone ec2-credentials-get)
salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e67082 access=722787eb540849158668370 salt '*' keystone.ec2_credentials_get user_id=c965f79c4f864eaaa9c3b41904e67082 access=722787eb540849158668370 salt '*' keystone.ec2_credentials_get name=nova access=722787eb540849158668370dc627ec5f
salt.modules.keystone.ec2_credentials_list(user_id=None, name=None, profile=None, **connection_args) Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list)
salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1c639c89e654 salt '*' keystone.ec2_credentials_list user_id=298ce377245c4ec9b70e1c639c89e654 salt '*' keystone.ec2_credentials_list name=jack
salt.modules.keystone.endpoint_create(service, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args) Create an endpoint for an Openstack service
salt 'v2' keystone.endpoint_create nova 'http://public/url' 'http://internal/url' 'http://adminurl/url' region
salt 'v3' keystone.endpoint_create nova url='http://public/url' interface='public' region='RegionOne'
salt.modules.keystone.endpoint_delete(service, region=None, profile=None, interface=None, **connection_args) Delete endpoints of an Openstack service
salt 'v2' keystone.endpoint_delete nova [region=RegionOne]
salt 'v3' keystone.endpoint_delete nova interface=admin [region=RegionOne]
salt.modules.keystone.endpoint_get(service, region=None, profile=None, interface=None, **connection_args) Return a specific endpoint (keystone endpoint-get)
salt 'v2' keystone.endpoint_get nova [region=RegionOne]
salt 'v3' keystone.endpoint_get nova interface=admin [region=RegionOne]
salt.modules.keystone.endpoint_list(profile=None, **connection_args) Return a list of available endpoints (keystone endpoints-list)
salt '*' keystone.endpoint_list
salt.modules.keystone.project_create(name, domain, description=None, enabled=True, profile=None, **connection_args) Create a keystone project.  Overrides keystone tenant_create form api V2. For keystone api V3.
name   The project name, which must be unique within the owning domain.
domain The domain name.
description The project description.
enabled Enables or disables the project.
profile Configuration profile - if configuration for multiple openstack accounts required.
salt '*' keystone.project_create nova default description='Nova Compute Project' salt '*' keystone.project_create test default enabled=False
salt.modules.keystone.project_delete(project_id=None, name=None, profile=None, **connection_args) Delete a project (keystone project-delete).  Overrides keystone tenant-delete form api V2. For keystone api V3 only.
project_id The project id.
name   The project name.
salt '*' keystone.project_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.project_delete project_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.project_delete name=demo
salt.modules.keystone.project_get(project_id=None, name=None, profile=None, **connection_args) Return a specific projects (keystone project-get) Overrides keystone tenant-get form api V2.  For keystone api V3 only.
salt '*' keystone.project_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.project_get project_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.project_get name=nova
salt.modules.keystone.project_list(profile=None, **connection_args) Return a list of available projects (keystone projects-list). Overrides keystone tenants-list form api V2.  For keystone api V3 only.
salt '*' keystone.project_list
salt.modules.keystone.project_update(project_id=None, name=None, description=None, enabled=None, profile=None, **connection_args) Update a tenant's information (keystone project-update) The following fields may be updated: name, description, enabled.  Can only update name if targeting by ID
Overrides keystone tenant_update form api V2.  For keystone api V3 only.
salt '*' keystone.project_update name=admin enabled=True salt '*' keystone.project_update c965f79c4f864eaaa9c3b41904e67082 name=admin email=admin@domain.com
salt.modules.keystone.role_create(name, profile=None, **connection_args) Create a named role.
salt '*' keystone.role_create admin
salt.modules.keystone.role_delete(role_id=None, name=None, profile=None, **connection_args) Delete a role (keystone role-delete)
salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_delete role_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_delete name=admin
salt.modules.keystone.role_get(role_id=None, name=None, profile=None, **connection_args) Return a specific roles (keystone role-get)
salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_get name=nova
salt.modules.keystone.role_list(profile=None, **connection_args) Return a list of available roles (keystone role-list)
salt '*' keystone.role_list
salt.modules.keystone.service_create(name, service_type, description=None, profile=None, **connection_args) Add service to Keystone service catalog
salt '*' keystone.service_create nova compute 'OpenStack Compute Service'
salt.modules.keystone.service_delete(service_id=None, name=None, profile=None, **connection_args) Delete a service from Keystone service catalog
salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova
salt.modules.keystone.service_get(service_id=None, name=None, profile=None, **connection_args) Return a specific services (keystone service-get)
salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_get service_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_get name=nova
salt.modules.keystone.service_list(profile=None, **connection_args) Return a list of available services (keystone services-list)
salt '*' keystone.service_list
salt.modules.keystone.tenant_create(name, description=None, enabled=True, profile=None, **connection_args) Create a keystone tenant
salt '*' keystone.tenant_create nova description='nova tenant' salt '*' keystone.tenant_create test enabled=False
salt.modules.keystone.tenant_delete(tenant_id=None, name=None, profile=None, **connection_args) Delete a tenant (keystone tenant-delete)
salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_delete name=demo
salt.modules.keystone.tenant_get(tenant_id=None, name=None, profile=None, **connection_args) Return a specific tenants (keystone tenant-get)
salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_get tenant_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_get name=nova
salt.modules.keystone.tenant_list(profile=None, **connection_args) Return a list of available tenants (keystone tenants-list)
salt '*' keystone.tenant_list
salt.modules.keystone.tenant_update(tenant_id=None, name=None, description=None, enabled=None, profile=None, **connection_args) Update a tenant's information (keystone tenant-update) The following fields may be updated: name, description, enabled.  Can only update name if targeting by ID
salt '*' keystone.tenant_update name=admin enabled=True salt '*' keystone.tenant_update c965f79c4f864eaaa9c3b41904e67082 name=admin email=admin@domain.com
salt.modules.keystone.token_get(profile=None, **connection_args) Return the configured tokens (keystone token-get)
salt '*' keystone.token_get c965f79c4f864eaaa9c3b41904e67082
salt.modules.keystone.user_create(name, password, email, tenant_id=None, enabled=True, profile=None, project_id=None, description=None, **connection_args) Create a user (keystone user-create)
salt '*' keystone.user_create name=jack password=zero email=jack@halloweentown.org         tenant_id=a28a7b5a999a455f84b1f5210264375e enabled=True
salt.modules.keystone.user_delete(user_id=None, name=None, profile=None, **connection_args) Delete a user (keystone user-delete)
salt '*' keystone.user_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.user_delete user_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.user_delete name=nova
salt.modules.keystone.user_get(user_id=None, name=None, profile=None, **connection_args) Return a specific users (keystone user-get)
salt '*' keystone.user_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.user_get user_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.user_get name=nova
salt.modules.keystone.user_list(profile=None, **connection_args) Return a list of available users (keystone user-list)
salt '*' keystone.user_list
salt.modules.keystone.user_password_update(user_id=None, name=None, password=None, profile=None, **connection_args) Update a user's password (keystone user-password-update)
salt '*' keystone.user_password_update c965f79c4f864eaaa9c3b41904e67082 password=12345 salt '*' keystone.user_password_update user_id=c965f79c4f864eaaa9c3b41904e67082 password=12345 salt '*' keystone.user_password_update name=nova password=12345
salt.modules.keystone.user_role_add(user_id=None, user=None, tenant_id=None, tenant=None, role_id=None, role=None, profile=None, project_id=None, project_name=None, **connection_args) Add role for user in tenant (keystone user-role-add)
salt '*' keystone.user_role_add user_id=298ce377245c4ec9b70e1c639c89e654 tenant_id=7167a092ece84bae8cead4bf9d15bb3b role_id=ce377245c4ec9b70e1c639c89e8cead4 salt '*' keystone.user_role_add user=admin tenant=admin role=admin
salt.modules.keystone.user_role_list(user_id=None, tenant_id=None, user_name=None, tenant_name=None, profile=None, project_id=None, project_name=None, **connection_args) Return a list of available user_roles (keystone user-roles-list)
salt '*' keystone.user_role_list user_id=298ce377245c4ec9b70e1c639c89e654 tenant_id=7167a092ece84bae8cead4bf9d15bb3b salt '*' keystone.user_role_list user_name=admin tenant_name=admin