neulab/tldr huggingface dataset:
accept_esp_in: iptables.append: - table: filter - chain: INPUT - jump: ACCEPT - source: 10.20.0.0/24 - destination: 10.10.0.0/24 - in-interface: eth0 - match: policy - dir: in - pol: ipsec - reqid: 1 - proto: esp accept_esp_forward_in: iptables.append: - use: - iptables: accept_esp_in - chain: FORWARD
accept_esp_out: iptables.append: - table: filter - chain: OUTPUT - jump: ACCEPT - source: 10.10.0.0/24 - destination: 10.20.0.0/24 - out-interface: eth0 - match: policy - dir: out - pol: ipsec - reqid: 1 - proto: esp accept_esp_forward_out: iptables.append: - use: - iptables: accept_esp_out - chain: FORWARD
NOTE: Various functions of the iptables module use the --check option. If the version of iptables on the target system does not include this option, an alternate version of this check will be performed using the output of iptables-save. This may have unintended consequences on legacy releases of iptables.
salt.states.iptables.append(name, table='filter', family='ipv4', **kwargs) New in version 0.17.0.
Add a rule to the end of the specified chain.
name   A user-defined name to call this rule by in another part of a state or formula. This should not be an actual rule.
table  The table that owns the chain which should be modified
All other arguments are passed in with the same name as the long option that would normally be used for iptables, with one exception: --state is specified as connstate instead of state (not to be confused with ctstate).
Jump options that doesn't take arguments should be passed in with an empty string.
salt.states.iptables.chain_absent(name, table='filter', family='ipv4') New in version 2014.1.0.
Verify the chain is absent.
table  The table to remove the chain from
salt.states.iptables.chain_present(name, table='filter', family='ipv4') New in version 2014.1.0.
Verify the chain is exist.
name   A user-defined chain name.
table  The table to own the chain.
salt.states.iptables.delete(name, table='filter', family='ipv4', **kwargs) New in version 2014.1.0.
Delete a rule to a chain
table  The table that owns the chain that should be modified
salt.states.iptables.flush(name, table='filter', family='ipv4', **kwargs) New in version 2014.1.0.
Flush current iptables state
chain  The chain to be flushed. All the chains in the table if none is given.
salt.states.iptables.insert(name, table='filter', family='ipv4', **kwargs) New in version 2014.1.0.
Insert a rule into a chain
position The numerical representation of where the rule should be inserted into the chain. Note that -1 is not a supported position value.
salt.states.iptables.mod_aggregate(low, chunks, running) The mod_aggregate function which looks up all rules in the available low chunks and merges them into a single rules ref in the present low data
salt.states.iptables.set_policy(name, table='filter', family='ipv4', **kwargs) New in version 2014.1.0.
Sets the default policy for iptables firewall tables
policy The requested table policy
salt.states.jboss7 Manage JBoss 7 Application Server via CLI interface
This state uses the jboss-cli.sh script from a JBoss or Wildfly installation and parses its output to determine the execution result.
In order to run each state, a jboss_config dictionary with the following properties must be passed:
jboss: cli_path: '/opt/jboss/jboss-7.0/bin/jboss-cli.sh' controller: 10.11.12.13:9999 cli_user: 'jbossadm' cli_password: 'jbossadm'
If the controller doesn't require a password, then the cli_user and cli_password parameters are optional.
Since same dictionary with configuration will be used in all the states, it may be more convenient to move JBoss configuration and other properties to the pillar.
Example of application deployment from local filesystem:
application_deployed: jboss7.deployed: - salt_source: target_file: '/tmp/webapp.war' - jboss_config: {{ pillar['jboss'] }}
For the sake of brevity, examples for each state assume that jboss_config is contained in the pillar.
salt.states.jboss7.bindings_exist(name, jboss_config, bindings, profile=None) Ensures that given JNDI binding are present on the server.  If a binding doesn't exist on the server it will be created.  If it already exists its value will be changed.
jboss_config: Dict with connection properties (see state description)
bindings: Dict with bindings to set.
profile: The profile name (domain mode only)
jndi_entries_created: jboss7.bindings_exist: - bindings: 'java:global/sampleapp/environment': 'DEV' 'java:global/sampleapp/configurationFile': '/var/opt/sampleapp/config.properties' - jboss_config: {{ pillar['jboss'] }}
salt.states.jboss7.datasource_exists(name, jboss_config, datasource_properties, recreate=False, profile=None) Ensures that a datasource with given properties exist on the jboss instance.  If datasource doesn't exist, it is created, otherwise only the properties that are different will be updated.
name   Datasource property name
jboss_config Dict with connection properties (see state description)
datasource_properties Dict with datasource properties
recreate False If set to True and datasource exists it will be removed and created again. However, if there are deployments that depend on the datasource, it will not me possible to remove it.
profile None The profile name for this datasource (domain mode only)
sampleDS: jboss7.datasource_exists: - recreate: False - datasource_properties: driver-name: mysql connection-url: 'jdbc:mysql://localhost:3306/sampleDatabase' jndi-name: 'java:jboss/datasources/sampleDS' user-name: sampleuser password: secret min-pool-size: 3 use-java-context: True - jboss_config: {{ pillar['jboss'] }} - profile: full-ha
salt.states.jboss7.deployed(name, jboss_config, salt_source=None) Ensures that the given application is deployed on server.
salt_source:
How to find the artifact to be deployed.
target_file: Where to look in the minion's file system for the artifact to be deployed (e.g. '/tmp/application-web-0.39.war').  When source is specified,  also specifies where to save the retrieved file.
source: (optional) File on salt master (e.g. salt://application-web-0.39.war).  If absent, no files will be retrieved and the artifact in target_file will be used for the deployment.
undeploy: (optional) Regular expression to match against existing deployments.  When present, if there is a deployment that matches the regular expression, it will be undeployed before the new artifact is deployed.
undeploy_force: (optional) If True, the artifact will be undeployed although it has not changed.
Deployment of a file from minion's local file system:
It is assumed that /tmp/webapp.war was made available by some other means.  No applications will be undeployed; if an existing deployment that shares that name exists, then it will be replaced with the updated version.
Deployment of a file from the Salt master's file system:
application_deployed: jboss7.deployed: - salt_source: source: salt://application-web-0.39.war target_file: '/tmp/application-web-0.39.war' undeploy: 'application-web-.*' - jboss_config: {{ pillar['jboss'] }}
Here, application-web-0.39.war file is downloaded from Salt file system to /tmp/application-web-0.39.war file on minion.  Existing deployments are checked if any of them matches 'application-web-.*' regular expression, and if so then it is undeployed before deploying the application. This is useful to automate deployment of new application versions.
If the source parameter of salt_source is specified, it can use any protocol that the file states use.  This includes not only downloading from the master but also HTTP, HTTPS, FTP, Amazon S3, and OpenStack Swift.
salt.states.jboss7.reloaded(name, jboss_config, timeout=60, interval=5) Reloads configuration of jboss server.
timeout: Time to wait until jboss is back in running state. Default timeout is 60s.
interval: Interval between state checks. Default interval is 5s. Decreasing the interval may slightly decrease waiting time but be aware that every status check is a call to jboss-cli which is a java process. If interval is smaller than process cleanup time it may easily lead to excessive resource consumption.
This step performs the following operations:
• Ensures that server is in running or reload-required state (by reading server-state attribute)
• Reloads configuration
• Waits for server to reload and be in running state
configuration_reloaded: jboss7.reloaded: - jboss_config: {{ pillar['jboss'] }}
salt.states.jenkins Management of Jenkins New in version 2016.3.0.
salt.states.jenkins.absent(name, **kwargs) Ensure the job is absent from the Jenkins configured jobs
name   The name of the Jenkins job to remove
salt.states.jenkins.present(name, config=None, **kwargs) Ensure the job is present in the Jenkins configured jobs
name   The unique name for the Jenkins job
config The Salt URL for the file to use for configuring the job
salt.states.junos State modules to interact with Junos devices. maturity new
salt.states.junos.cli(name, **kwargs) Executes the CLI commands and reuturns the text output.
show version: junos.cli: - format: xml
get software version of device: junos.cli: - name: show version - format: text - dest: /home/user/show_version.log
• Required -- .INDENT 2.0
• name: The command that need to be executed on Junos CLI. (default = None)
• Optional -- .INDENT 2.0
kwargs: Keyworded arguments which can be provided like-
• format: Format in which to get the CLI output. (text or xml,                 default = 'text')
• timeout: Set NETCONF RPC timeout. Can be used for commands which take a while to execute. (default = 30 seconds)
• dest: The destination file where the CLI output can be stored.               (default = None)
salt.states.junos.commit(name, **kwargs) Commits the changes loaded into the candidate configuration.
commit the changes: junos.commit: - confirm: 10
Parameters Optional -- .INDENT 7.0
• timeout: Set NETCONF RPC timeout. Can be used for commands which take a               while to execute. (default = 30 seconds)
• comment: Provide a comment to the commit. (default = None)
• confirm: Provide time in minutes for commit confirmation. If this option               is specified, the commit will be rollbacked in the given time               unless the commit is confirmed.
• sync: 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. (default = False)
• force_sync: On dual control plane systems, force the candidate configuration on one control plane to be copied to the other control plane.
• full: When set to True requires all the daemons to check and evaluate               the new configuration.
• detail: When true return commit detail.
salt.states.junos.commit_check(name) Perform a commit check on the configuration.
perform commit check: junos.commit_check
salt.states.junos.diff(name, d_id=0, **kwargs) Changed in version 3001.
Gets the difference between the candidate and the current configuration.
get the diff: junos.diff: - d_id: 10
• d_id: The rollback diff id (d_id) value [0-49]. (default = 0)
salt.states.junos.file_copy(name, dest=None, **kwargs) Copies the file from the local device to the junos device.
/home/m2/info.txt: junos.file_copy: - dest: info_copy.txt
Parameters Required -- .INDENT 7.0
• name: The sorce path where the file is kept.
• dest: The destination path where the file will be copied.
salt.states.junos.get_table(name, table, table_file, **kwargs) New in version 3001.
get route details: junos.get_table: - table: RouteTable - table_file: routes.yml
get interface details: junos.get_table: - table: EthPortTable - table_file: ethport.yml - table_args: interface_name: ge-0/0/0
name (required) task definition
file   YAML file that has the table specified in table parameter
template_args: key/value pair which should render Jinja template command
salt.states.junos.install_config(name, **kwargs) Loads and commits the configuration provided.
Install the mentioned config: junos.install_config: - name: salt://configs/interface.set - timeout: 100 - diffs_file: '/var/log/diff'
Install the mentioned config: junos.install_config: - path: salt://configs/interface.set - timeout: 100 - template_vars: interface_name: lo0 description: Creating interface via SaltStack.
name   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
template_vars The dictionary of data for the jinja variables present in the jinja template
timeout 30 Set NETCONF RPC timeout. Can be used for commands which take a while to execute.
comment Provide a comment to the commit. (default = None)
confirm Provide time in minutes for commit confirmation. If this option is specified, the commit will be rolled back in the given time unless the commit is confirmed.
diffs_file Path to the file where the diff (difference in old configuration and the committed configuration) will be stored.
NOTE: The file will be stored on the proxy minion. To push the files to the master use cp.push.
salt.states.junos.install_os(name, **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.
salt://images/junos_image.tgz: junos.install_os: - timeout: 100 - reboot: True
• name: Path where the image file is present on the pro xy minion.
kwargs: keyworded arguments to be given such as timeout, reboot etc
• timeout: Set NETCONF RPC timeout. Can be used to RPCs which take a while to execute. (default = 30 seconds)
• reboot: Whether to reboot after installation (default = False)
• no_copy: When True the software package will not be SCP’d to the device.               (default = False)
salt.states.junos.load(name, **kwargs) Loads the configuration provided onto the junos device.
Install the mentioned config: junos.load: - name: salt://configs/interface.set
Install the mentioned config: junos.load: - name: salt://configs/interface.set - template_vars: interface_name: lo0 description: Creating interface via SaltStack.
Sample template:
set interfaces {{ interface_name }} unit 0
name   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.
overwrite False Set to True if you want this file is to completely replace the configuration file.
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 (default = False)
template_vars Variables to be passed into the template processing engine in addition to those present in __pillar__, __opts__, __grains__, etc.  You may reference these variables in your template like so: {{ template_vars["var_name"] }}
salt.states.junos.lock(name) Attempts an exclusive lock on the candidate configuration. This is a non-blocking call.
NOTE: Any user who wishes to use lock, must necessarily unlock the configuration too. Ensure unlock is called in the same orchestration run in which the lock is called.
salt.states.junos.resultdecorator(function)
salt.states.junos.rollback(name, d_id, **kwargs) Rollbacks the committed changes.
rollback the changes: junos.rollback: - id: 5
• id:
• d_id: The rollback id value [0-49]. (default = 0) (this variable cannot be named id, it conflicts with the state compiler's internal id)
• diffs_file: Path to the file where any diffs will be written. (default = None)
salt.states.junos.rpc(name, dest=None, format='xml', args=None, **kwargs) Executes the given rpc. The returned data can be stored in a file by specifying the destination path with dest as an argument
get-interface-information: junos.rpc: - dest: /home/user/rpc.log - interface_name: lo0
fetch interface information with terse: junos.rpc: - name: get-interface-information - terse: True
• name: The rpc to be executed. (default = None)
• dest: Destination file where the rpc output is stored. (default = None) Note that the file will be stored on the proxy minion. To push the files to the master use the salt's following execution module:             cp.push
• format: The format in which the rpc reply must be stored in file specified in the dest (used only when dest is specified) (default = xml)
kwargs: keyworded arguments taken by rpc call like-
• timeout: 30 Set NETCONF RPC timeout. Can be used for commands which take a while to execute. (default= 30 seconds)
• filter: Only to be used with 'get-config' rpc to get specific configuration.
• terse: Amount of information you want.
• interface_name: Name of the interface whose information you want.
salt.states.junos.set_hostname(name, **kwargs) Changes the hostname of the device.
device_name: junos.set_hostname: - comment: "Host-name set via saltstack."
• name: The name to be set. (default = None)
• confirm: Provide time in minutes for commit confirmation.               If this option is specified, the commit will be rollbacked in the given time unless the commit is confirmed.
salt.states.junos.shutdown(name, **kwargs) Shuts down the device.
shut the device: junos.shutdown: - in_min: 10
kwargs:
• reboot: Whether to reboot instead of shutdown. (default=False)
• at: Specify time for reboot. (To be used only if reboot=yes)
• in_min: Specify delay in minutes for shutdown
salt.states.junos.unlock(name) Unlocks the candidate configuration.
salt.states.junos.zeroize(name) Resets the device to default factory settings.
reset my device: junos.zeroize
name: can be anything
salt.states.kapacitor Kapacitor state module.
kapacitor.unsafe_ssl: 'false' kapacitor.protocol: 'http' kapacitor.host: 'localhost' kapacitor.port: 9092
salt.states.kapacitor.task_absent(name) Ensure that a task is absent from Kapacitor.
salt.states.kapacitor.task_present(name, tick_script, task_type='stream', database=None, retention_policy='default', enable=True, dbrps=None) Ensure that a task is present and up-to-date in Kapacitor.
database Which database to fetch data from. Defaults to None, which will use the default database in InfluxDB.
enable Whether to enable the task or not. Defaults to True.
salt.states.kernelpkg Manage kernel packages and active kernel version Example state to install the latest kernel from package repositories:
install-latest-kernel: kernelpkg.latest_installed: []
Example state to boot the system if a new kernel has been installed:
boot-latest-kernel: kernelpkg.latest_active: - at_time: 1
Example state chaining the install and reboot operations:
boot-latest-kernel: kernelpkg.latest_active: - at_time: 1 - onchanges: - kernelpkg: install-latest-kernel
Chaining can also be achieved using wait/listen requisites:
boot-latest-kernel: kernelpkg.latest_wait: - at_time: 1 - listen: - kernelpkg: install-latest-kernel
salt.states.kernelpkg.latest_active(name, at_time=None, **kwargs) Initiate a reboot if the running kernel is not the latest one installed.
NOTE: This state does not install any patches. It only compares the running kernel version number to other kernel versions also installed in the system. If the running version is not the latest one installed, this state will reboot the system.
See kernelpkg.upgrade and latest_installed() for ways to install new kernel packages.
This module does not attempt to understand or manage boot loader configurations it is possible to have a new kernel installed, but a boot loader configuration that will never activate it. For this reason, it would not be advisable to schedule this state to run automatically.
Because this state function may cause the system to reboot, it may be preferable to move it to the very end of the state run. See latest_wait() for a waitable state that can be called with the listen requesite.
name   Arbitrary name for the state. Does not affect behavior.
salt.states.kernelpkg.latest_installed(name, **kwargs) Ensure that the latest version of the kernel available in the repositories is installed.
NOTE: This state only installs the kernel, but does not activate it. The new kernel should become active at the next reboot.  See kernelpkg.needs_reboot for details on how to detect this condition, and latest_active() to initiale a reboot when needed.
salt.states.kernelpkg.latest_wait(name, at_time=None, **kwargs) Initiate a reboot if the running kernel is not the latest one installed. This is the waitable version of latest_active() and will not take any action unless triggered by a watch or listen requesite.
NOTE: Because this state function may cause the system to reboot, it may be preferable to move it to the very end of the state run using listen or listen_in requisites.
system-up-to-date: pkg.uptodate: - refresh: true
boot-latest-kernel: kernelpkg.latest_wait: - at_time: 1 - listen: - pkg: system-up-to-date
salt.states.kernelpkg.mod_watch(name, sfun, **kwargs) Execute a kernelpkg state based on a watch or listen call
salt.states.keyboard Management of keyboard layouts The keyboard layout can be managed for the system:
us: keyboard.system
Or it can be managed for XOrg:
us: keyboard.xorg
salt.states.keyboard.system(name) Set the keyboard layout for the system
name   The keyboard layout to use
salt.states.keyboard.xorg(name) Set the keyboard layout for XOrg
layout The keyboard layout to use
salt.states.keystone Management of Keystone users depends
configuration See salt.modules.keystone for setup instructions.
Keystone tenants: keystone.tenant_present: - names: - admin - demo - service
Keystone roles: keystone.role_present: - names: - admin - Member
admin: keystone.user_present: - password: R00T_4CC3SS - email: admin@domain.com - roles: admin:   # tenants - admin  # roles service: - admin - Member - require: - keystone: Keystone tenants - keystone: Keystone roles
nova: keystone.user_present: - password: '$up3rn0v4' - email: nova@domain.com - tenant: service - roles: service: - admin - require: - keystone: Keystone tenants - keystone: Keystone roles
demo: keystone.user_present: - password: 'd3m0n$trati0n' - email: demo@domain.com - tenant: demo - roles: demo: - Member - require: - keystone: Keystone tenants - keystone: Keystone roles
nova service: keystone.service_present: - name: nova - service_type: compute - description: OpenStack Compute Service
salt.states.keystone.endpoint_absent(name, region=None, profile=None, interface=None, **connection_args) Ensure that the endpoint for a service doesn't exist in Keystone catalog
name   The name of the service whose endpoints should not exist
region (optional) The region of the endpoint.  Defaults to RegionOne.
interface The interface type, which describes the visibility of the endpoint. (for V3 API)
salt.states.keystone.endpoint_present(name, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args) Ensure the specified endpoints exists for service
name   The Service name
publicurl The public url of service endpoint (for V2 API)
internalurl The internal url of service endpoint (for V2 API)
adminurl The admin url of the service endpoint (for V2 API)
region The region of the endpoint
url    The endpoint URL (for V3 API)
salt.states.keystone.project_absent(name, profile=None, **connection_args) Ensure that the keystone project is absent.  Alias for tenant_absent from V2 API to fulfill V3 API naming convention.
name   The name of the project that should not exist
delete_nova: keystone.project_absent: - name: nova
salt.states.keystone.project_present(name, description=None, enabled=True, profile=None, **connection_args) Ensures that the keystone project exists Alias for tenant_present from V2 API to fulfill V3 API naming convention.
name   The name of the project to manage
description The description to use for this project
enabled Availability state for this project
nova: keystone.project_present: - enabled: True - description: 'Nova Compute Service'
salt.states.keystone.role_absent(name, profile=None, **connection_args) Ensure that the keystone role is absent.
name   The name of the role that should not exist
salt.states.keystone.role_present(name, profile=None, **connection_args) ' Ensures that the keystone role exists
name   The name of the role that should be present
salt.states.keystone.service_absent(name, profile=None, **connection_args) Ensure that the service doesn't exist in Keystone catalog
name   The name of the service that should not exist
salt.states.keystone.service_present(name, service_type, description=None, profile=None, **connection_args) Ensure service present in Keystone catalog
name   The name of the service
service_type The type of Openstack Service
description (optional) Description of the service
salt.states.keystone.tenant_absent(name, profile=None, **connection_args) Ensure that the keystone tenant is absent.
name   The name of the tenant that should not exist
salt.states.keystone.tenant_present(name, description=None, enabled=True, profile=None, **connection_args) Ensures that the keystone tenant exists
name   The name of the tenant to manage
description The description to use for this tenant
enabled Availability state for this tenant
salt.states.keystone.user_absent(name, profile=None, **connection_args) Ensure that the keystone user is absent.
name   The name of the user that should not exist
salt.states.keystone.user_present(name, password, email, tenant=None, enabled=True, roles=None, profile=None, password_reset=True, project=None, **connection_args) Ensure that the keystone user is present with the specified properties.
password The password to use for this user.
NOTE: If the user already exists and a different password was set for the user than the one specified here, the password for the user will be updated. Please set the password_reset option to False if this is not the desired behavior.
password_reset Whether or not to reset password after initial set. Defaults to True.
email  The email address for this user
tenant The tenant (name) for this user
project The project (name) for this user (overrides tenant in api v3)
enabled Availability state for this user
roles  The roles the user should have under given tenants.  Passed as a dictionary mapping tenant names to a list of roles in this tenant, i.e.:
roles: admin:   # tenant - admin  # role service: - admin - Member
salt.states.keystone_domain Management of OpenStack Keystone Domains New in version 2018.3.0.
configuration see salt.modules.keystoneng for setup instructions
create domain: keystone_domain.present: - name: domain1
create domain with optional params: keystone_domain.present: - name: domain1 - enabled: False - description: 'my domain'
delete domain: keystone_domain.absent: - name: domain1
salt.states.keystone_domain.absent(name, auth=None) Ensure domain does not exist
name   Name of the domain
salt.states.keystone_domain.present(name, auth=None, **kwargs) Ensure domain exists and is up-to-date
enabled Boolean to control if domain is enabled
description An arbitrary description of the domain
salt.states.keystone_endpoint Management of OpenStack Keystone Endpoints New in version 2018.3.0.
create endpoint: keystone_endpoint.present: - name: public - url: https://example.org:9292 - region: RegionOne - service_name: glance
destroy endpoint: keystone_endpoint.absent: - name: public - url: https://example.org:9292 - region: RegionOne - service_name: glance
create multiple endpoints: keystone_endpoint.absent: - names: - public - admin - internal - url: https://example.org:9292 - region: RegionOne - service_name: glance
salt.states.keystone_endpoint.absent(name, service_name, auth=None, **kwargs) Ensure an endpoint does not exists
name   Interface name
url    URL of the endpoint
service_name Service name or ID
region The region name to assign the endpoint
salt.states.keystone_endpoint.present(name, service_name, auth=None, **kwargs) Ensure an endpoint exists and is up-to-date
enabled Boolean to control if endpoint is enabled
salt.states.keystone_group Management of OpenStack Keystone Groups New in version 2018.3.0.
create group: keystone_group.present: - name: group1
delete group: keystone_group.absent: - name: group1
create group with optional params: keystone_group.present: - name: group1 - domain: domain1 - description: 'my group'
salt.states.keystone_group.absent(name, auth=None, **kwargs) Ensure group does not exist
domain The name or id of the domain
salt.states.keystone_group.present(name, auth=None, **kwargs) Ensure an group exists and is up-to-date
description An arbitrary description of the group
salt.states.keystone_project Management of OpenStack Keystone Projects New in version 2018.3.0.
create project: keystone_project.present: - name: project1
delete project: keystone_project.absent: - name: project1
create project with optional params: keystone_project.present: - name: project1 - domain: domain1 - enabled: False - description: 'my project'
salt.states.keystone_project.absent(name, auth=None, **kwargs) Ensure a project does not exists
name   Name of the project
salt.states.keystone_project.present(name, auth=None, **kwargs) Ensure a project exists and is up-to-date
description An arbitrary description of the project
salt.states.keystone_role Management of OpenStack Keystone Roles New in version 2018.3.0.
create role: keystone_role.present: - name: role1
delete role: keystone_role.absent: - name: role1
create role with optional params: keystone_role.present: - name: role1 - description: 'my group'
salt.states.keystone_role.absent(name, auth=None, **kwargs) Ensure role does not exist
name   Name of the role
salt.states.keystone_role.present(name, auth=None, **kwargs) Ensure an role exists
description An arbitrary description of the role
salt.states.keystone_role_grant Management of OpenStack Keystone Role Grants New in version 2018.3.0.
salt.states.keystone_role_grant.absent(name, auth=None, **kwargs)
salt.states.keystone_role_grant.present(name, auth=None, **kwargs)
salt.states.keystone_service Management of OpenStack Keystone Services New in version 2018.3.0.
create service: keystone_service.present: - name: glance - type: image
delete service: keystone_service.absent: - name: glance
create service with optional params: keystone_service.present: - name: glance - type: image - enabled: False - description: 'OpenStack Image'
salt.states.keystone_service.absent(name, auth=None) Ensure service does not exist
name   Name of the service
salt.states.keystone_service.present(name, auth=None, **kwargs) Ensure an service exists and is up-to-date
type   Service type
enabled Boolean to control if service is enabled
description An arbitrary description of the service
salt.states.keystone_user Management of OpenStack Keystone Users New in version 2018.3.0.
create user: keystone_user.present: - name: user1
delete user: keystone_user.absent: - name: user1
create user with optional params: keystone_user.present: - name: user1 - domain: domain1 - enabled: False - password: password123 - email: "user1@example.org" - description: 'my user'
salt.states.keystone_user.absent(name, auth=None, **kwargs) Ensure user does not exists
name   Name of the user
salt.states.keystone_user.present(name, auth=None, **kwargs) Ensure domain exists and is up-to-date
password The user password
email  The users email address
salt.states.keystore State management of a java keystore
salt.states.keystore.managed(name, passphrase, entries, force_remove=False) Create or manage a java keystore.
name   The path to the keystore file
passphrase The password to the keystore
entries A list containing an alias, certificate, and optional private_key.  The certificate and private_key can be a file or a string
- entries: - alias: hostname2 certificate: /path/to/cert.crt private_key: /path/to/key.key - alias: stringhost certificate: | -----BEGIN CERTIFICATE----- MIICEjCCAXsCAg36MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG ... 2VguKv4SWjRFoRkIfIlHX0qVviMhSlNy2ioFLy7JcPZb+v3ftDGywUqcBiVDoea0 -----END CERTIFICATE-----
force_remove If True will cause the state to remove any entries found in the keystore which are not defined in the state. The default is False.
define_keystore: keystore.managed: - name: /path/to/keystore - passphrase: changeit - force_remove: True - entries: - alias: hostname1 certificate: /path/to/cert.crt - alias: remotehost certificate: /path/to/cert2.crt private_key: /path/to/key2.key - alias: pillarhost certificate: {{ salt.pillar.get('path:to:cert') }}
salt.states.kmod Loading and unloading of kernel modules The Kernel modules on a system can be managed cleanly with the kmod state module:
add_kvm: kmod.present: - name: kvm_amd remove_beep: kmod.absent: - name: pcspkr
Multiple modules can be specified for both kmod.present and kmod.absent.
add_sound: kmod.present: - mods: - snd_hda_codec_hdmi - snd_hda_codec - snd_hwdep - snd_hda_core - snd_pcm - snd_timer - snd
salt.states.kmod.absent(name, persist=False, comment=True, mods=None) Verify that the named kernel module is not loaded
name   The name of the kernel module to verify is not loaded
persist Remove module from /etc/modules
comment Comment out module in /etc/modules rather than remove it
mods   A list of modules to verify are unloaded.  If this argument is used, the name argument, although still required, is not used, and becomes a placeholder
salt.states.kmod.present(name, persist=False, mods=None) Ensure that the specified kernel module is loaded
name   The name of the kernel module to verify is loaded
persist Also add module to /etc/modules
mods   A list of modules to verify are loaded.  If this argument is used, the name argument, although still required, is not used, and becomes a placeholder
salt.states.kubernetes Manage kubernetes resources as salt states NOTE: This module requires the proper pillar values set. See salt.modules.kubernetesmod for more information.
WARNING: Configuration options will change in 2019.2.0.
The kubernetes module is used to manage different kubernetes resources.
my-nginx: kubernetes.deployment_present: - namespace: default metadata: app: frontend spec: replicas: 1 template: metadata: labels: run: my-nginx spec: containers: - name: my-nginx image: nginx ports: - containerPort: 80
my-mariadb: kubernetes.deployment_absent: - namespace: default
# kubernetes deployment as specified inside of # a file containing the definition of the the # deployment using the official kubernetes format redis-master-deployment: kubernetes.deployment_present: - name: redis-master - source: salt://k8s/redis-master-deployment.yml require: - pip: kubernetes-python-module
# kubernetes service as specified inside of # a file containing the definition of the the # service using the official kubernetes format redis-master-service: kubernetes.service_present: - name: redis-master - source: salt://k8s/redis-master-service.yml require: - kubernetes.deployment_present: redis-master
# kubernetes deployment as specified inside of # a file containing the definition of the the # deployment using the official kubernetes format # plus some jinja directives nginx-source-template: kubernetes.deployment_present: - source: salt://k8s/nginx.yml.jinja - template: jinja require: - pip: kubernetes-python-module
# Kubernetes secret k8s-secret: kubernetes.secret_present: - name: top-secret data: key1: value1 key2: value2 key3: value3
salt.states.kubernetes.configmap_absent(name, namespace='default', **kwargs) Ensures that the named configmap is absent from the given namespace.
name   The name of the configmap
namespace The namespace holding the configmap. The 'default' one is going to be used unless a different one is specified.
salt.states.kubernetes.configmap_present(name, namespace='default', data=None, source=None, template=None, **kwargs) Ensures that the named configmap is present inside of the specified namespace with the given data.  If the configmap exists it will be replaced.
name   The name of the configmap.
data   The dictionary holding the configmaps.
source A file containing the data of the configmap in plain format.
template Template engine to be used to render the source file.
salt.states.kubernetes.deployment_absent(name, namespace='default', **kwargs) Ensures that the named deployment is absent from the given namespace.
name   The name of the deployment
namespace The name of the namespace
salt.states.kubernetes.deployment_present(name, namespace='default', metadata=None, spec=None, source='', template='', **kwargs) Ensures that the named deployment is present inside of the specified namespace with the given metadata and spec.  If the deployment exists it will be replaced.
name   The name of the deployment.
namespace The namespace holding the deployment. The 'default' one is going to be used unless a different one is specified.
metadata The metadata of the deployment object.
spec   The spec of the deployment object.
source A file containing the definition of the deployment (metadata and spec) in the official kubernetes format.
salt.states.kubernetes.namespace_absent(name, **kwargs) Ensures that the named namespace is absent.
name   The name of the namespace
salt.states.kubernetes.namespace_present(name, **kwargs) Ensures that the named namespace is present.
name   The name of the namespace.
salt.states.kubernetes.node_label_absent(name, node, **kwargs) Ensures that the named label is absent from the node.
name   The name of the label
node   The name of the node
salt.states.kubernetes.node_label_folder_absent(name, node, **kwargs) Ensures the label folder doesn't exist on the specified node.
name   The name of label folder
salt.states.kubernetes.node_label_present(name, node, value, **kwargs) Ensures that the named label is set on the named node with the given value.  If the label exists it will be replaced.
name   The name of the label.
value  Value of the label.
node   Node to change.
salt.states.kubernetes.pod_absent(name, namespace='default', **kwargs) Ensures that the named pod is absent from the given namespace.
name   The name of the pod
salt.states.kubernetes.pod_present(name, namespace='default', metadata=None, spec=None, source='', template='', **kwargs) Ensures that the named pod is present inside of the specified namespace with the given metadata and spec.  If the pod exists it will be replaced.
name   The name of the pod.
namespace The namespace holding the pod. The 'default' one is going to be used unless a different one is specified.
metadata The metadata of the pod object.
spec   The spec of the pod object.
source A file containing the definition of the pod (metadata and spec) in the official kubernetes format.
salt.states.kubernetes.secret_absent(name, namespace='default', **kwargs) Ensures that the named secret is absent from the given namespace.
name   The name of the secret
salt.states.kubernetes.secret_present(name, namespace='default', data=None, source=None, template=None, **kwargs) Ensures that the named secret is present inside of the specified namespace with the given data.  If the secret exists it will be replaced.
name   The name of the secret.
namespace The namespace holding the secret. The 'default' one is going to be used unless a different one is specified.
data   The dictionary holding the secrets.
source A file containing the data of the secret in plain format.
salt.states.kubernetes.service_absent(name, namespace='default', **kwargs) Ensures that the named service is absent from the given namespace.
salt.states.kubernetes.service_present(name, namespace='default', metadata=None, spec=None, source='', template='', **kwargs) Ensures that the named service is present inside of the specified namespace with the given metadata and spec.  If the deployment exists it will be replaced.
name   The name of the service.
namespace The namespace holding the service. The 'default' one is going to be used unless a different one is specified.
metadata The metadata of the service object.
spec   The spec of the service object.
source A file containing the definition of the service (metadata and spec) in the official kubernetes format.
salt.states.layman Management of Gentoo Overlays using layman A state module to manage Gentoo package overlays via layman
sunrise: layman.present
salt.states.layman.absent(name) Verify that the overlay is absent
name   The name of the overlay to delete
salt.states.layman.present(name) Verify that the overlay is present
name   The name of the overlay to add
salt.states.ldap Manage entries in an LDAP database New in version 2016.3.0.
The states.ldap state module allows you to manage LDAP entries and their attributes.
salt.states.ldap.managed(name, entries, connect_spec=None) Ensure the existence (or not) of LDAP entries and their attributes
ldapi:///: ldap.managed: - connect_spec: bind: method: sasl
- entries:
# make sure the entry doesn't exist - cn=foo,ou=users,dc=example,dc=com: - delete_others: True
# make sure the entry exists with only the specified # attribute values - cn=admin,dc=example,dc=com: - delete_others: True - replace: cn: - admin description: - LDAP administrator objectClass: - simpleSecurityObject - organizationalRole userPassword: - {{pillar.ldap_admin_password}}
# make sure the entry exists, its olcRootDN attribute # has only the specified value, the olcRootDN attribute # doesn't exist, and all other attributes are ignored - 'olcDatabase={1}hdb,cn=config': - replace: olcRootDN: - cn=admin,dc=example,dc=com # the admin entry has its own password attribute olcRootPW: []
# note the use of 'default'.  also note how you don't # have to use list syntax if there is only one attribute # value - cn=foo,ou=users,dc=example,dc=com: - delete_others: True - default: userPassword: changeme shadowLastChange: 0 # keep sshPublicKey if present, but don't create # the attribute if it is missing sshPublicKey: [] - replace: cn: foo uid: foo uidNumber: 1000 gidNumber: 1000 gecos: Foo Bar givenName: Foo sn: Bar homeDirectory: /home/foo loginShell: /bin/bash objectClass: - inetOrgPerson - posixAccount - top - ldapPublicKey - shadowAccount
• name -- The URL of the LDAP server.  This is ignored if connect_spec is either a connection object or a dict with a 'url' entry.
• entries --
A description of the desired state of zero or more LDAP entries.
entries is an iterable of dicts.  Each of these dict's keys are the distinguished names (DNs) of LDAP entries to manage.  Each of these dicts is processed in order.  A later dict can reference an LDAP entry that was already mentioned in an earlier dict, which makes it possible for later dicts to enhance or alter the desired state of an LDAP entry.
The DNs are mapped to a description of the LDAP entry's desired state.  These LDAP entry descriptions are themselves iterables of dicts.  Each dict in the iterable is processed in order.  They contain directives controlling the entry's state.  The key names the directive type and the value is state information for the directive.  The specific structure of the state information depends on the directive type.
The structure of entries looks like this:
[{dn1: [{directive1: directive1_state, directive2: directive2_state}, {directive3: directive3_state}], dn2: [{directive4: directive4_state, directive5: directive5_state}]}, {dn3: [{directive6: directive6_state}]}]
These are the directives:
'delete_others' Boolean indicating whether to delete attributes not mentioned in this dict or any of the other directive dicts for this DN.  Defaults to False.
If you don't want to delete an attribute if present, but you also don't want to add it if it is missing or modify it if it is present, you can use either the 'default' directive or the 'add' directive with an empty value list.
'default' A dict mapping an attribute name to an iterable of default values for that attribute.  If the attribute already exists, it is left alone.  If not, it is created using the given list of values.
An empty value list is useful when you don't want to create an attribute if it is missing but you do want to preserve it if the 'delete_others' key is True.
'add'  Attribute values to add to the entry.  This is a dict mapping an attribute name to an iterable of values to add.
'delete' Attribute values to remove from the entry.  This is a dict mapping an attribute name to an iterable of values to delete from the attribute. If the iterable is empty, all of the attribute's values are deleted.
'replace' Attributes to replace.  This is a dict mapping an attribute name to an iterable of values.  Any existing values for the attribute are deleted, then the given values are added.  The iterable may be empty.
In the above directives, the iterables of attribute values may instead be None, in which case an empty list is used, or a scalar such as a string or number, in which case a new list containing the scalar is used.
Note that if all attribute values are removed from an entry, the entire entry is deleted.
• connect_spec -- See the description of the connect_spec parameter of the ldap3.connect function in the ldap3 execution module.  If this is a dict and the 'url' entry is not specified, the 'url' entry is set to the value of the name parameter.
Returns A dict with the following keys:
'name' This is the same object passed to the name parameter.
'changes' This is a dict describing the changes made (or, in test mode, the changes that would have been attempted).  If no changes were made (or no changes would have been attempted), then this dict is empty.  Only successful changes are included.
Each key is a DN of an entry that was changed (or would have been changed).  Entries that were not changed (or would not have been changed) are not included.  The value is a dict with two keys:
'old'  The state of the entry before modification.  If the entry did not previously exist, this key maps to None. Otherwise, the value is a dict mapping each of the old entry's attributes to a list of its values before any modifications were made.  Unchanged attributes are excluded from this dict.
'new'  The state of the entry after modification.  If the entry was deleted, this key maps to None.  Otherwise, the value is a dict mapping each of the entry's attributes to a list of its values after the modifications were made. Unchanged attributes are excluded from this dict.
Example 'changes' dict where a new entry was created with a single attribute containing two values:
{'dn1': {'old': None, 'new': {'attr1': ['val1', 'val2']}}}
Example 'changes' dict where a new attribute was added to an existing entry:
{'dn1': {'old': {}, 'new': {'attr2': ['val3']}}}
'result' One of the following values:
• True if no changes were necessary or if all changes were applied successfully.
• False if at least one change was unable to be applied.
• None if changes would be applied but it is in test mode.
salt.states.libcloud_dns Manage DNS records and zones using libcloud
codeauthor Anthony Shaw <anthonyshaw@apache.org>
Create and delete DNS records or zones through Libcloud. Libcloud's DNS system supports over 20 DNS providers including Amazon, Google, GoDaddy, Softlayer
This module uses libcloud, which can be installed via package, or pip.
libcloud_dns: profile1: driver: godaddy key: 2orgk34kgk34g profile2: driver: route53 key: blah secret: blah
my-zone: libcloud_dns.zone_present: - name: mywebsite.com - profile: profile1 my-website: libcloud_dns.record_present: - name: www - zone: mywebsite.com - type: A - data: 12.34.32.3 - profile: profile1 - require: - libcloud_dns: my-zone
salt.states.libcloud_dns.record_absent(name, zone, type, data, profile) Ensures a record is absent.
• zone (str) -- Zone where the requested record is created, the domain name
salt.states.libcloud_dns.record_present(name, zone, type, data, profile) Ensures a record is present.
salt.states.libcloud_dns.state_result(result, message, name, changes=None)
salt.states.libcloud_dns.zone_absent(domain, profile) Ensures a record is absent.
• domain (str) -- Zone name, i.e. the domain name
salt.states.libcloud_dns.zone_present(domain, type, profile) Ensures a record is present.
• type (str) -- Zone type (master / slave), defaults to master
salt.states.libcloud_loadbalancer Apache Libcloud Load Balancer State Manage load balancers using libcloud
Apache Libcloud load balancer management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/latest/loadbalancer/supported_providers.html
configuration This module uses a configuration profile for one or multiple Cloud providers