neulab/tldr huggingface dataset:
salt.states.gnomedesktop.wm_preferences(name, user=None, action_double_click_titlebar=None, action_middle_click_titlebar=None, action_right_click_titlebar=None, application_based=None, audible_bell=None, auto_raise=None, auto_raise_delay=None, button_layout=None, disable_workarounds=None, focus_mode=None, focus_new_windows=None, mouse_button_modifier=None, num_workspaces=None, raise_on_click=None, resize_with_right_button=None, theme=None, titlebar_font=None, titlebar_uses_system_font=None, visual_bell=None, visual_bell_type=None, workspace_names=None, **kwargs) wm_preferences: sets values in the org.gnome.desktop.wm.preferences schema
salt.states.gpg Management of the GPG keychains New in version 2016.3.0.
salt.states.gpg.absent(name, keys=None, user=None, gnupghome=None, **kwargs) Ensure GPG public key is absent in keychain
name   The unique name or keyid for the GPG public key.
keys   The keyId or keyIds to add to the GPG keychain.
user   Remove GPG keys from the specified user's keychain
gnupghome Override GNUPG Home directory
salt.states.gpg.present(name, keys=None, user=None, keyserver=None, gnupghome=None, trust=None, **kwargs) Ensure GPG public key is present in keychain
user   Add GPG keys to the specified user's keychain
keyserver The keyserver to retrieve the keys from.
trust  Trust level for the key in the keychain, ignored by default.  Valid trust levels: expired, unknown, not_trusted, marginally, fully, ultimately
salt.states.grafana Manage Grafana Dashboards
This module uses elasticsearch, which can be installed via package, or pip.
You can specify elasticsearch hosts directly to the module, or you can use an elasticsearch profile via pillars:
mygrafanaprofile: hosts: - es1.example.com:9200 - es2.example.com:9200 index: grafana-dash
# Basic usage (uses default pillar profile key 'grafana') Ensure myservice dashboard is managed: grafana.dashboard_present: - name: myservice - dashboard_from_pillar: default - rows_from_pillar: - systemhealth - requests
# Passing hosts in Ensure myservice dashboard is managed: grafana.dashboard_present: - name: myservice - dashboard_from_pillar: default - rows: - collapse: false editable: true height: 150px title: System Health panels: - aliasColors: {} id: 200000 annotate: enable: false bars: false datasource: null editable: true error: false fill: 7 grid: leftMax: 100 leftMin: null rightMax: null rightMin: null threshold1: 60 threshold1Color: rgb(216, 27, 27) threshold2: null threshold2Color: rgba(234, 112, 112, 0.22) leftYAxisLabel: '' legend: avg: false current: false max: false min: false show: false total: false values: false lines: true linewidth: 1 nullPointMode: connected percentage: false pointradius: 5 points: false renderer: flot resolution: 100 scale: 1 seriesOverrides: [] span: 4 stack: false steppedLine: false targets: - target: cloudwatch.aws.ec2.mysrv.cpuutilization.average title: CPU (asg average) tooltip: query_as_alias: true shared: false value_type: cumulative type: graph x-axis: true y-axis: true y_formats: - short - short zerofill: true - rows_from_pillar: - systemhealth - requests - profile: hosts: - es1.example.com:9200 - es2.example.com:9200 index: grafana-dash
# Using a profile from pillars Ensure myservice dashboard is managed: grafana.dashboard_present: - name: myservice - dashboard: annotations: enable: true list: [] editable: true hideAllLegends: false hideControls: false nav: - collapse: false enable: true notice: false now: true refresh_intervals: - 10s - 30s - 1m - 5m - 15m - 30m - 1h - 2h - 1d status: Stable time_options: - 5m - 15m - 1h - 2h - 3h - 4h - 6h - 12h - 1d - 2d - 4d - 7d - 16d - 30d type: timepicker originalTitle: dockerregistry refresh: 1m rows: [] sharedCrosshair: false style: dark tags: [] templating: enable: true list: [] time: from: now-2h to: now timezone: browser - rows_from_pillars: - systemhealth - requests - profile: mygrafanaprofile
The behavior of this module is to create dashboards if they do not exist, to add rows if they do not exist in existing dashboards, and to update rows if they exist in dashboards. The module will not manage rows that are not defined, allowing users to manage their own custom rows.
salt.states.grafana.dashboard_absent(name, hosts=None, profile='grafana') Ensure the named grafana dashboard is deleted.
name   Name of the grafana dashboard.
profile A pillar key or dict that contains a list of hosts and an elasticsearch index to use.
salt.states.grafana.dashboard_present(name, dashboard=None, dashboard_from_pillar=None, rows=None, rows_from_pillar=None, profile='grafana') Ensure the grafana dashboard exists and is managed.
dashboard A dict that defines a dashboard that should be managed.
dashboard_from_pillar A pillar key that contains a grafana dashboard dict. Mutually exclusive with dashboard.
rows   A list of grafana rows.
rows_from_pillar A list of pillar keys that contain lists of grafana dashboard rows.  Rows defined in the pillars will be appended to the rows defined in the state.
salt.states.grafana4_dashboard Manage Grafana v4.0 Dashboards
configuration This state requires a configuration profile to be configured in the minion config, minion pillar, or master config. The module will use the 'grafana' key by default, if defined.
Example configuration using basic authentication:
Example configuration using token based authentication:
grafana: grafana_url: http://grafana.localhost grafana_token: token grafana_timeout: 3
Ensure minimum dashboard is managed: grafana4_dashboard.present: - name: insightful-dashboard - base_dashboards_from_pillar: - default_dashboard - base_rows_from_pillar: - default_row - base_panels_from_pillar: - default_panel - dashboard: rows: - title: Usage panels: - targets: - target: alias(constantLine(50), 'max') title: Imaginary type: graph
salt.states.grafana4_dashboard.absent(name, orgname=None, profile='grafana') Ensure the named grafana dashboard is absent.
orgname Name of the organization in which the dashboard should be present.
salt.states.grafana4_dashboard.present(name, base_dashboards_from_pillar=None, base_panels_from_pillar=None, base_rows_from_pillar=None, dashboard=None, orgname=None, profile='grafana') Ensure the grafana dashboard exists and is managed.
base_dashboards_from_pillar A pillar key that contains a list of dashboards to inherit from
base_panels_from_pillar A pillar key that contains a list of panels to inherit from
base_rows_from_pillar A pillar key that contains a list of rows to inherit from
salt.states.grafana4_datasource Manage Grafana v4.0 data sources
The behavior of this module is to create data sources if the do not exists, and to update data sources if the already exists.
Ensure influxdb data source is present: grafana4_datasource.present: - name: influxdb - type: influxdb - url: http://localhost:8086 - access: proxy - basic_auth: true - basic_auth_user: myuser - basic_auth_password: mypass - is_default: true
salt.states.grafana4_datasource.absent(name, orgname=None, profile='grafana') Ensure that a data source is present.
name   Name of the data source to remove.
orgname Name of the organization from which the data source should be absent.
salt.states.grafana4_datasource.present(name, type, url, access=None, user=None, password=None, database=None, basic_auth=None, basic_auth_user=None, basic_auth_password=None, tls_auth=None, json_data=None, is_default=None, with_credentials=None, type_logo_url=None, orgname=None, profile='grafana') Ensure that a data source is present.
access Use proxy or direct. Default: proxy
basic_auth Optional - set to True to use HTTP basic auth to authenticate with the data source.
basic_auth_user Optional - HTTP basic auth username.
basic_auth_password Optional - HTTP basic auth password.
json_data Optional - additional json data to post (eg. "timeInterval").
is_default Optional - set data source as default.
with_credentials Optional - Whether credentials such as cookies or auth headers should be sent with cross-site requests.
type_logo_url Optional - Logo to use for this datasource.
orgname Name of the organization in which the data source should be present.
salt.states.grafana4_org Manage Grafana v4.0 orgs
Ensure foobar org is present: grafana4_org.present: - name: foobar - theme:  "" - home_dashboard_id: 0 - timezone: "utc" - address1: "" - address2: "" - city: "" - zip_code: "" - state: "" - country: ""
salt.states.grafana4_org.absent(name, profile='grafana') Ensure that a org is present.
name   Name of the org to remove.
salt.states.grafana4_org.present(name, users=None, theme=None, home_dashboard_id=None, timezone=None, address1=None, address2=None, city=None, zip_code=None, address_state=None, country=None, profile='grafana') Ensure that an organization is present.
name   Name of the org.
users  Optional - Dict of user/role associated with the org. Example:
users: foo: Viewer bar: Editor
theme  Optional - Selected theme for the org.
home_dashboard_id Optional - Home dashboard for the org.
timezone Optional - Timezone for the org (one of: "browser", "utc", or "").
address_state Optional - state of the org.
salt.states.grafana4_user Manage Grafana v4.0 users
Ensure foobar user is present: grafana4_user.present: - name: foobar - password: mypass - email: "foobar@localhost" - fullname: Foo Bar - is_admin: true
salt.states.grafana4_user.absent(name, profile='grafana') Ensure that a user is present.
name   Name of the user to remove.
salt.states.grafana4_user.present(name, password, email, is_admin=False, fullname=None, theme=None, profile='grafana') Ensure that a user is present.
name   Name of the user.
password Password of the user.
email  Email of the user.
is_admin Optional - Set user as admin user. Default: False
fullname Optional - Full name of the user.
theme  Optional - Selected theme of the user.
salt.states.grafana_dashboard Manage Grafana v2.0 Dashboards
grafana: grafana_timeout: 3 grafana_token: qwertyuiop grafana_url: 'https://url.com'
Ensure minimum dashboard is managed: grafana_dashboard.present: - name: insightful-dashboard - base_dashboards_from_pillar: - default_dashboard - base_rows_from_pillar: - default_row - base_panels_from_pillar: - default_panel - dashboard: rows: - title: Usage panels: - targets: - target: alias(constantLine(50), 'max') title: Imaginary type: graph
salt.states.grafana_dashboard.absent(name, profile='grafana') Ensure the named grafana dashboard is absent.
profile A pillar key or dict that contains grafana information
salt.states.grafana_dashboard.present(name, base_dashboards_from_pillar=None, base_panels_from_pillar=None, base_rows_from_pillar=None, dashboard=None, profile='grafana') Ensure the grafana dashboard exists and is managed.
salt.states.grafana_datasource Manage Grafana v2.0 data sources
Ensure influxdb data source is present: grafana_datasource.present: - name: influxdb - type: influxdb - url: http://localhost:8086 - access: proxy - basic_auth: true - basic_auth_user: myuser - basic_auth_password: mypass - is_default: true
salt.states.grafana_datasource.absent(name, profile='grafana') Ensure that a data source is present.
salt.states.grafana_datasource.present(name, type, url, access='proxy', user='', password='', database='', basic_auth=False, basic_auth_user='', basic_auth_password='', is_default=False, json_data=None, profile='grafana') Ensure that a data source is present.
type   Which type of data source it is ('graphite', 'influxdb' etc.).
user   Optional - user to authenticate with the data source
password Optional - password to authenticate with the data source
is_default Default: False
salt.states.grains Manage grains on the minion This state allows for grains to be set.
Grains set or altered with this module are stored in the 'grains' file on the minions, By default, this file is located at: /etc/salt/grains
salt.states.grains.absent(name, destructive=False, delimiter=':', force=False) New in version 2014.7.0.
Delete a grain from the grains config file
name   The grain name
destructive If destructive is True, delete the entire grain. If destructive is False, set the grain's value to None. Defaults to False.
force  If force is True, the existing grain will be overwritten regardless of its existing or provided value type. Defaults to False
delimiter A delimiter different from the default can be provided.
Changed in version 2015.8.2.
This state now support nested grains and complex values. It is also more conservative: if a grain has a value that is a list or a dict, it will not be removed unless the force parameter is True.
grain_name: grains.absent
salt.states.grains.append(name, value, convert=False, delimiter=':') New in version 2014.7.0.
Append a value to a list in the grains config file. The grain that is being appended to (name) must exist before the new value can be added.
value  The value to append
grain_name: grains.append: - value: to_be_appended
salt.states.grains.exists(name, delimiter=':') Ensure that a grain is set
Check whether a grain exists. Does not attempt to check or set the value.
salt.states.grains.list_absent(name, value, delimiter=':') Delete a value from a grain formed as a list.
name   The grain name.
value  The value to delete from the grain list.
delimiter A delimiter different from the default : can be provided.
The grain should be list type
roles: grains.list_absent: - value: db
For multiple grains, the syntax looks like:
roles: grains.list_absent: - value: - web - dev
salt.states.grains.list_present(name, value, delimiter=':') New in version 2014.1.0.
Ensure the value is present in the list-type grain. Note: If the grain that is provided in name is not present on the system, this new grain will be created with the corresponding provided value.
value  The value is present in the list type grain.
roles: grains.list_present: - value: web
roles: grains.list_present: - value: - web - dev
salt.states.grains.make_hashable(list_grain, result=None) Ensure that a list grain is hashable.
list_grain The list grain that should be hashable
result This function is recursive, so it must be possible to use a sublist as parameter to the function. Should not be used by a caller outside of the function.
Make it possible to compare two list grains to each other if the list contains complex objects.
salt.states.grains.present(name, value, delimiter=':', force=False) Ensure that a grain is set
value  The value to set on the grain
It is now capable to set a grain to a complex value (ie. lists and dicts) and supports nested grains as well.
If the grain does not yet exist, a new grain is set to the given value. For a nested grain, the necessary keys are created if they don't exist. If a given key is an existing value, it will be converted, but an existing value different from the given key will fail the state.
If the grain with the given name exists, its value is updated to the new value unless its existing or provided value is complex (list or dict). Use force: True to overwrite.
cheese: grains.present: - value: edam
nested_grain_with_complex_value: grains.present: - name: icinga:Apache SSL - value: - command: check_https - params: -H localhost -p 443 -S
with,a,custom,delimiter: grains.present: - value: yay - delimiter: ','
salt.states.group Management of user groups The group module is used to create and manage group settings, groups can be either present or absent. User/Group names can be passed to the adduser, deluser, and members parameters. adduser and deluser can be used together but not with members.
In Windows, if no domain is specified in the user or group name (i.e. DOMAIN\username) the module will assume a local user or group.
cheese: group.present: - gid: 7648 - system: True - addusers: - user1 - users2 - delusers: - foo
cheese: group.present: - gid: 7648 - system: True - members: - foo - bar - user1 - user2
salt.states.group.absent(name) Ensure that the named group is absent
# Removes the local group `db_admin` db_admin: group.absent
salt.states.group.present(name, gid=None, system=False, addusers=None, delusers=None, members=None) Ensure that a group is present
• name (str) -- The name of the group to manage
• gid (str) -- The group id to assign to the named group; if left empty, then the next available group id will be assigned. Ignored on Windows
• system (bool) -- Whether or not the named group is a system group.  This is essentially the '-r' option of 'groupadd'. Ignored on Windows
• addusers (list) -- List of additional users to be added as a group members. Cannot conflict with names in delusers. Cannot be used in conjunction with members.
• delusers (list) -- Ensure these user are removed from the group membership. Cannot conflict with names in addusers. Cannot be used in conjunction with members.
• members (list) -- Replace existing group members with a list of new members. Cannot be used in conjunction with addusers or delusers.
# Adds DOMAIN\db_admins and Administrators to the local db_admin group # Removes Users db_admin: group.present: - addusers: - DOMAIN\db_admins - Administrators - delusers: - Users
# Ensures only DOMAIN\domain_admins and the local Administrator are # members of the local Administrators group. All other users are # removed Administrators: group.present: - members: - DOMAIN\domain_admins - Administrator
salt.states.heat Management of Heat New in version 2017.7.0.
• heat Python module
configuration See salt.modules.heat for setup instructions.
The heat module is used to create, show, list and delete Heat staks. Stack can be set as either absent or deploy.
heat.deployed: - name: - template: #Required - environment: - params: {} - poll: 5 - rollback: False - timeout: 60
heat.absent: - name: - poll: 5
heat.deployed:
• template: salt://templates/mysql.heat.yaml
• params: image: Debian 7
• rollback: True
salt.states.heat.absent(name, poll=5, timeout=60, profile=None) Ensure that the named stack is absent
name   The name of the stack to remove
poll   Poll(in sec.) and report events until stack complete
salt.states.heat.deployed(name, template=None, environment=None, params=None, poll=5, rollback=False, timeout=60, update=False, profile=None, **connection_args) Deploy stack with the specified properties
name   The name of the stack
template File of template
params Parameter dict used to create the stack
poll   Poll (in sec.) and report events until stack complete
salt.states.helm salt.states.helm.release_absent(name, namespace=None, flags=None, kvflags=None) Make sure the release name is absent.
name   (string) The release name to uninstall.
helm_release_is_absent: helm.release_absent: - name: release_name
# In dry-run mode. helm_release_is_absent_dry-run: helm.release_absent: - name: release_name - flags: - dry-run
salt.states.helm.release_present(name, chart, values=None, version=None, namespace=None, set=None, flags=None, kvflags=None) Make sure the release name is present.
name   (string) The release name to install.
chart  (string) The chart to install.
helm_release_is_present: helm.release_present: - name: release_name - chart: repo/chart
# In dry-run mode. helm_release_is_present_dry-run: helm.release_present: - name: release_name - chart: repo/chart - flags: - dry-run
# With values.yaml file. helm_release_is_present_values: helm.release_present: - name: release_name - chart: repo/chart - kvflags: values: /path/to/values.yaml
salt.states.helm.repo_managed(name, present=None, absent=None, prune=False, repo_update=False, namespace=None, flags=None, kvflags=None) Make sure the repository is updated.
name   (string) Not used.
repo_update (boolean - default: False) If True, the Helm repository is updated after a repository add or remove.
helm_repository_is_managed: helm.repo_managed: - present: - name: local_name_1 url: repository_url - absent: - local_name_2
salt.states.helm.repo_updated(name, namespace=None, flags=None, kvflags=None) Make sure the repository is updated.  To execute after a repository changes.
helm_repository_is_updated: helm.repo_updated
salt.states.hg Interaction with Mercurial repositories Before using hg over ssh, make sure the remote host fingerprint already exists in ~/.ssh/known_hosts, and the remote host has this host's public key.
https://bitbucket.org/example_user/example_repo: hg.latest: - rev: tip - target: /tmp/example_repo
salt.states.hg.latest(name, rev=None, target=None, clean=False, user=None, identity=None, force=False, opts=False, update_head=True) Make sure the repository is cloned to the given directory and is up to date
name   Address of the remote repository as passed to "hg clone"
rev    The remote branch, tag, or revision hash to clone/pull
target Target destination directory path on minion to clone into
clean  Force a clean update with -C (Default: False)
user   Name of the user performing repository management operations
identity Private SSH key on the minion server for authentication (‐ ssh://)
force  Force hg to clone into pre-existing directories (deletes contents)
opts   Include additional arguments and options to the hg command line
update_head Should we update the head if new changes are found? Defaults to True
salt.states.highstate_doc To be used with processors in module highstate_doc.
salt.states.highstate_doc.note(name, source=None, contents=None, **kwargs) Add content to a document generated using highstate_doc.render.
This state does not preform any tasks on the host. It only is used in highstate_doc lowstate processors to include extra documents.
{{sls}} example note: highstate_doc.note: - name: example note - require_in: - pkg: somepackage - contents: | example `highstate_doc.note` ------------------ This state does not do anything to the system! It is only used by a `processor` you can use `requisites` and `order` to move your docs around the rendered file. .. this message appare above the `pkg: somepackage` state. - source: salt://{{tpldir}}/also_include_a_file.md
{{sls}} extra help: highstate_doc.note: - name: example - order: 0 - source: salt://{{tpldir}}/HELP.md
salt.states.host Management of addresses and names in hosts file The /etc/hosts file can be managed to contain definitions for specific hosts:
salt-master: host.present: - ip: 192.168.0.42
Or using the names directive, you can put several names for the same IP. (Do not try one name with space-separated values).
server1: host.present: - ip: 192.168.0.42 - names: - server1 - florida
NOTE: Changing the names in host.present does not cause an update to remove the old entry.
server1: host.present: - ip: - 192.168.0.42 - 192.168.0.43 - 192.168.0.44 - names: - server1
You can replace all existing names for a particular IP address:
127.0.1.1: host.only: - hostnames: - foo.example.com - foo
Or delete all existing names for an address:
203.0.113.25: host.only: - hostnames: []
You can also include comments:
server1: host.present: - ip: 192.168.0.42 - names: - server1 - florida - comment: A very important comment
salt.states.host.absent(name, ip) Ensure that the named host is absent
name   The host to remove
ip     The ip addr(s) of the host to remove
salt.states.host.only(name, hostnames) Ensure that only the given hostnames are associated with the given IP address.
name   The IP address to associate with the given hostnames.
hostnames Either a single hostname or a list of hostnames to associate with the given IP address in the given order. Any other hostname associated with the IP address is removed.  If no hostnames are specified, all hostnames associated with the given IP address are removed.
salt.states.host.present(name, ip, comment='', clean=False) Ensures that the named host is present with the given ip
name   The host to assign an ip to
ip     The ip addr(s) to apply to the host. Can be a single IP or a list of IP addresses.
comment A comment to include for the host entry
clean  Remove any entries which don't match those configured in the ip option. Default is False.
salt.states.http HTTP monitoring states
Perform an HTTP query and statefully return the result
salt.states.http.query(name, match=None, match_type='string', status=None, status_type='string', wait_for=None, **kwargs) Perform an HTTP query and statefully return the result
name   The name of the query.
match  Specifies a pattern to look for in the return text. By default, this will perform a string comparison of looking for the value of match in the return text.
match_type Specifies the type of pattern matching to use on match. Default is string, but can also be set to pcre to use regular expression matching if a more complex pattern matching is required.
NOTE: Despite the name of match_type for this argument, this setting actually uses Python's re.search() function rather than Python's re.match() function.
status The status code for a URL for which to be checked. Can be used instead of or in addition to the match setting. This can be passed as an individual status code or a list of status codes.
status_type Specifies the type of pattern matching to use for status. Default is string, but can also be set to pcre to use regular expression matching if a more complex pattern matching is required. Additionally, if a list of strings representing statuses is given, the type list can be used.
If both match and status options are set, both settings will be checked.  However, note that if only one option is True and the other is False, then False will be returned. If this case is reached, the comments in the return data will contain troubleshooting information.
For more information about the http.query state, refer to the HTTP Tutorial.
query_example: http.query: - name: 'http://example.com/' - status: 200
query_example2: http.query: - name: 'http://example.com/' - status: - 200 - 201 - status_type: list
salt.states.http.wait_for_successful_query(name, wait_for=300, **kwargs) Like query but, repeat and wait until match/match_type or status is fulfilled. State returns result from last query state in case of success or if no successful query was made within wait_for timeout.
wait_for Total time to wait for requests that succeed.
request_interval Optional interval to delay requests by N seconds to reduce the number of requests sent.
NOTE: All other arguments are passed to the http.query state.
salt.states.icinga2 Icinga2 state New in version 2017.7.0.
• Icinga2 Python module
configuration See salt.modules.icinga2 for setup instructions.
The icinga2 module is used to execute commands.  Its output may be stored in a file or in a grain.
command_id: icinga2.generate_ticket: - name: domain.tld - output:  "/tmp/query_id.txt"
salt.states.icinga2.generate_cert(name) Generate an icinga2 certificate and key on the client.
name   The domain name for which this certificate and key will be generated
salt.states.icinga2.generate_ticket(name, output=None, grain=None, key=None, overwrite=True) Generate an icinga2 ticket on the master.
name   The domain name for which this ticket will be generated
output grain: output in a grain other: the file to store results None:  output to the result comment (default)
grain: grain to store the output (need output=grain)
key:   the specified grain will be treated as a dictionary, the result of this state will be stored under the specified key.
overwrite: The file or grain will be overwritten if it already exists (default)
salt.states.icinga2.node_setup(name, master, ticket) Setup the icinga2 node.
name   The domain name for which this certificate will be saved
master Icinga2 master node for which this certificate will be saved
ticket Authentication ticket generated on icinga2 master
salt.states.icinga2.request_cert(name, master, ticket, port='5665') Request CA certificate from master icinga2 node.
port   Icinga2 port, defaults to 5665
salt.states.icinga2.save_cert(name, master) Save the certificate on master icinga2 node.
salt.states.idem Idem Support This state provides access to idem states
salt.states.idem.state(name, sls, acct_file=None, acct_key=None, acct_profile=None, cache_dir=None, render=None, runtime=None, source_dir=None, test=False) Execute an idem sls file through a salt state
sls    A list of idem sls files or sources
acct_profile Name of the profile to add to idem's ctx.acct parameter Defaults to the value in the ACCT_PROFILE environment variable.
cache_dir The location to use for the cache directory
render The render pipe to use, this allows for the language to be specified (jinja|yaml)
runtime Select which execution runtime to use (serial|parallel)
source_dir The directory containing sls files
cheese: idem.state: - runtime: parallel - sls: - idem_state.sls - sls_source
salt.states.ifttt Trigger an event in IFTTT This state is useful for trigging events in IFTTT.
ifttt-event: ifttt.trigger_event: - event: TestEvent - value1: 'This state was executed successfully.' - value2: 'Another value we can send.' - value3: 'A third value we can send.'
The api key can be specified in the master or minion configuration like below: .. code-block:: yaml
ifttt: secret_key: bzMRb-KKIAaNOwKEEw792J7Eb-B3z7muhdhYblJn4V6
salt.states.ifttt.trigger_event(name, event, value1=None, value2=None, value3=None) Trigger an event in IFTTT
ifttt-event: ifttt.trigger_event: - event: TestEvent - value1: 'A value that we want to send.' - value2: 'A second value that we want to send.' - value3: 'A third value that we want to send.'
name   The unique name for this event.
event  The name of the event to trigger in IFTTT.
value1 One of the values that we can send to IFTT.
value2 One of the values that we can send to IFTT.
value3 One of the values that we can send to IFTT.
salt.states.incron Management of incron, the inotify cron The incron state module allows for user incrontabs to be cleanly managed.
Incron declarations require a number of parameters. The parameters needed to be declared: path, mask, and cmd. The user whose incrontab is to be edited also needs to be defined.
When making changes to an existing incron job, the path declaration is the unique factor, so if an existing cron that looks like this:
Watch for modifications in /home/user: incron.present: - user: root - path: /home/user - mask: - IN_MODIFY - cmd: 'echo "$$ $@"'
Watch for modifications and access in /home/user: incron.present: - user: root - path: /home/user - mask: - IN_MODIFY - IN_ACCESS - cmd: 'echo "$$ $@"'
salt.states.incron.absent(name, path, mask, cmd, user='root') Verifies that the specified incron job is absent for the specified user; only the name is matched when removing a incron job.
name   Unique comment describing the entry
path   The path that should be watched
user   The name of the user who's crontab needs to be modified, defaults to the root user
mask   The mask of events that should be monitored for
cmd    The cmd that should be executed
salt.states.incron.present(name, path, mask, cmd, user='root') Verifies that the specified incron job is present for the specified user.  For more advanced information about what exactly can be set in the cron timing parameters, check your incron system's documentation. Most Unix-like systems' incron documentation can be found via the incrontab man page: man 5 incrontab.
salt.states.influxdb08_database Management of Influxdb 0.8 databases (compatible with InfluxDB version 0.5-0.8)
salt.states.influxdb08_database.absent(name, user=None, password=None, host=None, port=None) Ensure that the named database is absent
name   The name of the database to remove
user   The user to connect as (must be able to remove the database)
salt.states.influxdb08_database.present(name, user=None, password=None, host=None, port=None) Ensure that the named database is present
name   The name of the database to create
salt.states.influxdb08_user Management of InfluxDB 0.8 users (compatible with InfluxDB version 0.5-0.8)
salt.states.influxdb08_user.absent(name, database=None, user=None, password=None, host=None, port=None) Ensure that the named cluster admin or database user is absent.
name   The name of the user to remove
user   The user to connect as (must be able to remove the user)
salt.states.influxdb08_user.present(name, passwd, database=None, user=None, password=None, host=None, port=None) Ensure that the cluster admin or database user is present.
name   The name of the user to manage
passwd The password of the user
user   The user to connect as (must be able to create the user)
salt.states.influxdb_continuous_query Management of Influxdb continuous queries New in version 2017.7.0.
(compatible with InfluxDB version 0.9+)
salt.states.influxdb_continuous_query.absent(name, database, **client_args) Ensure that given continuous query is absent.
name   Name of the continuous query to remove.
database Name of the database that the continuous query was defined on.
salt.states.influxdb_continuous_query.present(name, database, query, resample_time=None, coverage_period=None, **client_args) Ensure that given continuous query is present.
database Database to create continuous query on.
query  The query content
salt.states.influxdb_database Management of Influxdb databases (compatible with InfluxDB version 0.9+)
salt.states.influxdb_database.absent(name, **client_args) Ensure that given database is absent.
name   Name of the database to remove.
salt.states.influxdb_database.present(name, **client_args) Ensure that given database is present.
salt.states.influxdb_retention_policy Management of Influxdb retention policies New in version 2017.7.0.
salt.states.influxdb_retention_policy.absent(name, database, **client_args) Ensure that given retention policy is absent.
name   Name of the retention policy to remove.
database Name of the database that the retention policy was defined on.
salt.states.influxdb_retention_policy.convert_duration(duration) Convert the a duration string into XXhYYmZZs format
duration Duration to convert
Returns: duration_string String representation of duration in XXhYYmZZs format
salt.states.influxdb_retention_policy.present(name, database, duration='7d', replication=1, default=False, **client_args) Ensure that given retention policy is present.
name   Name of the retention policy to create.
database Database to create retention policy on.
salt.states.influxdb_user Management of InfluxDB users (compatible with InfluxDB version 0.9+)
salt.states.influxdb_user.absent(name, **client_args) Ensure that given user is absent.
salt.states.influxdb_user.present(name, passwd, admin=False, grants=None, **client_args) Ensure that given user is present.
name   Name of the user to manage
passwd Password of the user
grants Optional - Dict of database:privilege items associated with the user. Example:
grants: foo_db: read bar_db: all
example user present in influxdb: influxdb_user.present: - name: example - passwd: somepassword - admin: False - grants: foo_db: read bar_db: all
salt.states.infoblox_a Infoblox A record management.
functions accept api_opts: api_verifyssl: verify SSL [default to True or pillar value] api_url: server to connect to [default to pillar value] api_username:  [default to pillar value] api_password:  [default to pillar value]
salt.states.infoblox_a.absent(name=None, ipv4addr=None, **api_opts) Ensure infoblox A record is removed.
State example:
infoblox_a.absent: - name: example-ha-0.domain.com
infoblox_a.absent: - name: - ipv4addr: 127.0.23.23
salt.states.infoblox_a.present(name=None, ipv4addr=None, data=None, ensure_data=True, **api_opts) Ensure infoblox A record.
When you wish to update a hostname ensure name is set to the hostname of the current record. You can give a new name in the data.name.
infoblox_a.present: - name: example-ha-0.domain.com - data: name: example-ha-0.domain.com ipv4addr: 123.0.31.2 view: Internal
salt.states.infoblox_cname Infoblox CNAME management.
salt.states.infoblox_cname.absent(name=None, canonical=None, **api_opts) Ensure the CNAME with the given name or canonical name is removed
salt.states.infoblox_cname.present(name=None, data=None, ensure_data=True, **api_opts) Ensure the CNAME with the given data is present.
name   CNAME of record
data   raw CNAME api data see: https://INFOBLOX/wapidoc
infoblox_cname.present: - name: example-ha-0.domain.com - data: name: example-ha-0.domain.com canonical: example.domain.com zone: example.com view: Internal comment: Example comment
infoblox_cname.present: - name: example-ha-0.domain.com - data: name: example-ha-0.domain.com canonical: example.domain.com zone: example.com view: Internal comment: Example comment - api_url: https://INFOBLOX/wapi/v1.2.1 - api_username: username - api_password: passwd
salt.states.infoblox_host_record Infoblox host record management.
salt.states.infoblox_host_record.absent(name=None, ipv4addr=None, mac=None, **api_opts) Ensure the host with the given Name ipv4addr or mac is removed.
infoblox_host_record.absent: - name: hostname.of.record.to.remove
infoblox_host_record.absent: - name: - ipv4addr: 192.168.0.1
infoblox_host_record.absent: - name: - mac: 12:02:12:31:23:43
salt.states.infoblox_host_record.present(name=None, data=None, ensure_data=True, **api_opts) This will ensure that a host with the provided name exists.  This will try to ensure that the state of the host matches the given data If the host is not found then one will be created.
When trying to update a hostname ensure name is set to the hostname of the current record. You can give a new name in the data.name.
Avoid race conditions, use func:nextavailableip:
• func:nextavailableip:10.0.0.0/8,externalconfigure_for_dns
# this would update `original_hostname.example.ca` to changed `data`. infoblox_host_record.present: - name: original_hostname.example.ca - data: {'namhostname.example.cae': 'hostname.example.ca', 'aliases': ['hostname.math.example.ca'], 'extattrs': [{'Business Contact': {'value': 'EXAMPLE@example.ca'}}], 'ipv4addrs': [{'configure_for_dhcp': True, 'ipv4addr': 'func:nextavailableip:129.97.139.0/24', 'mac': '00:50:56:84:6e:ae'}], 'ipv6addrs': [], }
salt.states.infoblox_range Infoblox host record management.
salt.states.infoblox_range.absent(name=None, start_addr=None, end_addr=None, data=None, **api_opts) Ensure the range is removed
Supplying the end of the range is optional.
infoblox_range.absent: - name: 'vlan10'
infoblox_range.absent: - name: - start_addr: 127.0.1.20
salt.states.infoblox_range.present(name=None, start_addr=None, end_addr=None, data=None, **api_opts) Ensure range record is present.
infoblox_range.present: start_addr: '129.97.150.160', end_addr: '129.97.150.170',
Verbose state example:
infoblox_range.present: data: { 'always_update_dns': False, 'authority': False, 'comment': 'range of IP addresses used for salt.. was used for ghost images deployment', 'ddns_generate_hostname': True, 'deny_all_clients': False, 'deny_bootp': False, 'disable': False, 'email_list': [], 'enable_ddns': False, 'enable_dhcp_thresholds': False, 'enable_email_warnings': False, 'enable_ifmap_publishing': False, 'enable_snmp_warnings': False, 'end_addr': '129.97.150.169', 'exclude': [], 'extattrs': {}, 'fingerprint_filter_rules': [], 'high_water_mark': 95, 'high_water_mark_reset': 85, 'ignore_dhcp_option_list_request': False, 'lease_scavenge_time': -1, 'logic_filter_rules': [], 'low_water_mark': 0, 'low_water_mark_reset': 10, 'mac_filter_rules': [], 'member': {'_struct': 'dhcpmember', 'ipv4addr': '129.97.128.9', 'name': 'cn-dhcp-mc.example.ca'}, 'ms_options': [], 'nac_filter_rules': [], 'name': 'ghost-range', 'network': '129.97.150.0/24', 'network_view': 'default', 'option_filter_rules': [], 'options': [{'name': 'dhcp-lease-time', 'num': 51, 'use_option': False, 'value': '43200', 'vendor_class': 'DHCP'}], 'recycle_leases': True, 'relay_agent_filter_rules': [], 'server_association_type': 'MEMBER', 'start_addr': '129.97.150.160', 'update_dns_on_lease_renewal': False, 'use_authority': False, 'use_bootfile': False, 'use_bootserver': False, 'use_ddns_domainname': False, 'use_ddns_generate_hostname': True, 'use_deny_bootp': False, 'use_email_list': False, 'use_enable_ddns': False, 'use_enable_dhcp_thresholds': False, 'use_enable_ifmap_publishing': False, 'use_ignore_dhcp_option_list_request': False, 'use_known_clients': False, 'use_lease_scavenge_time': False, 'use_nextserver': False, 'use_options': False, 'use_recycle_leases': False, 'use_unknown_clients': False, 'use_update_dns_on_lease_renewal': False }
salt.states.ini_manage Manage ini files maintainer <akilesh1597@gmail.com>
salt.states.ini_manage.options_absent(name, sections=None, separator='=')
/home/saltminion/api-paste.ini: ini.options_absent: - separator: '=' - sections: test: - testkey - secondoption test1: - testkey1
options present in file and not specified in sections dict will be untouched
changes dict will contain the list of changes made
salt.states.ini_manage.options_present(name, sections=None, separator='=', strict=False)
/home/saltminion/api-paste.ini: ini.options_present: - separator: '=' - strict: True - sections: test: testkey: 'testval' secondoption: 'secondvalue' test1: testkey1: 'testval121'
options present in file and not specified in sections dict will be untouched, unless strict: True flag is used
salt.states.ini_manage.sections_absent(name, sections=None, separator='=')
/home/saltminion/api-paste.ini: ini.sections_absent: - separator: '=' - sections: - test - test1
options present in file and not specified in sections will be deleted changes dict will contain the sections that changed
salt.states.ini_manage.sections_present(name, sections=None, separator='=')
/home/saltminion/api-paste.ini: ini.sections_present: - separator: '=' - sections: - section_one - section_two
This will only create empty sections. To also create options, use options_present state
salt.states.ipmi Manage IPMI devices over LAN The following configuration defaults can be defined in the minion, master config or pillar:
Every call can override the config defaults:
ensure myipmi system is set to network boot: ipmi.boot_device: - name: network - api_host: myipmi.hostname.com - api_user: root - api_pass: apassword - api_kg: None
ensure myipmi system is powered on: ipmi.power: - name: boot - api_host: myipmi.hostname.com - api_user: root - api_pass: apassword
salt.states.ipmi.boot_device(name='default', **kwargs) Request power state change
name = default
• network -- Request network boot
• hd -- Boot from hard drive
• safe -- Boot from hard drive, requesting 'safe mode'
• optical -- boot from CD/DVD/BD drive
• setup -- Boot into setup utility
• default -- remove any IPMI directed boot device request
• api_host=localhost
• api_pass=
salt.states.ipmi.power(name='power_on', wait=300, **kwargs) Request power state change
Ensure power state one of:
wait   wait X seconds for the job to complete before forcing. (defaults to 300 seconds)
salt.states.ipmi.user_absent(name, channel=14, **kwargs) Remove user Delete all user (uid) records having the matching name.
name   string name of user to delete
channel channel to remove user access from defaults to 14 for auto.
salt.states.ipmi.user_present(name, uid, password, channel=14, callback=False, link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs) Ensure IPMI user and user privileges.
name   name of user (limit 16 bytes)
uid    user id number (1 to 7)
password user password (limit 16 bytes)
channel ipmi channel defaults to 14 for auto
callback User Restricted to Callback
False = User Privilege Limit is determined by the User Privilege Limit parameter privilege_level, for both callback and non-callback connections.
True = User Privilege Limit is determined by the privilege_level parameter for callback connections, but is restricted to Callback level for non-callback connections. Thus, a user can only initiate a Callback when they 'call in' to the BMC, but once the callback connection has been made, the user could potentially establish a session as an Operator.
link_auth User Link authentication True/False user name and password information will be used for link authentication, e.g. PPP CHAP) for the given channel. Link authentication itself is a global setting for the channel and is enabled/disabled via the serial/modem configuration parameters.
ipmi_msg User IPMI Messaging True/False user name and password information will be used for IPMI Messaging. In this case, 'IPMI Messaging' refers to the ability to execute generic IPMI commands that are not associated with a particular payload type. For example, if IPMI Messaging is disabled for a user, but that user is enabled for activating the SOL payload type, then IPMI commands associated with SOL and session management, such as Get SOL Configuration Parameters and Close Session are available, but generic IPMI commands such as Get SEL Time are unavailable.) ipmi_msg
privilege_level
salt.states.ipset Management of ipsets This is an ipset-specific module designed to manage IPSets for use in IPTables Firewalls.
setname: ipset.set_present: - set_type: bitmap:ip - range: 192.168.0.0/16 - comment: True
setname: ipset.set_absent: - set_type: bitmap:ip - range: 192.168.0.0/16 - comment: True
setname_entries: ipset.present: - set_name: setname - entry: 192.168.0.3 - comment: Hello - require: - ipset: baz
setname_entries: ipset.present: - set_name: setname - entry: - 192.168.0.3 - 192.168.1.3 - comment: Hello - require: - ipset: baz
setname_entries: ipset.absent: - set_name: setname - entry: - 192.168.0.3 - 192.168.1.3 - comment: Hello - require: - ipset: baz
setname: ipset.flush:
salt.states.ipset.absent(name, entry=None, entries=None, family='ipv4', **kwargs) New in version 2014.7.0.
Remove a entry or entries from a chain
name   A user-defined name to call this entry by in another part of a state or formula. This should not be an actual entry.
family Network family, ipv4 or ipv6.
salt.states.ipset.flush(name, family='ipv4', **kwargs) New in version 2014.7.0.
Flush current ipset set
salt.states.ipset.present(name, entry=None, family='ipv4', **kwargs) New in version 2014.7.0.
Append a entry to a set
entry  A single entry to add to a set or a list of entries to add to a set
salt.states.ipset.set_absent(name, family='ipv4', **kwargs) New in version 2014.7.0.
Verify the set is absent.
salt.states.ipset.set_present(name, set_type, family='ipv4', **kwargs) New in version 2014.7.0.
Verify the set exists.
name   A user-defined set name.
set_type The type for the set.
salt.states.iptables Management of iptables This is an iptables-specific module designed to manage Linux firewalls. It is expected that this state module, and other system-specific firewall states, may at some point be deprecated in favor of a more generic firewall state.
httpd: iptables.append: - table: filter - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.append: - table: filter - chain: INPUT - jump: ACCEPT - match: - state - comment - comment: "Allow HTTP" - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.append: - table: filter - chain: INPUT - jump: ACCEPT - match: - state - comment - comment: "Allow HTTP" - connstate: NEW - source: '127.0.0.1' - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
.. Invert Rule httpd: iptables.append: - table: filter - chain: INPUT - jump: ACCEPT - match: - state - comment - comment: "Allow HTTP" - connstate: NEW - source: '! 127.0.0.1' - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.append: - table: filter - chain: INPUT - jump: ACCEPT - match: - state - comment - comment: "Allow HTTP" - connstate: NEW - source: 'not 127.0.0.1' - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.append: - table: filter - family: ipv6 - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.append: - table: filter - family: ipv4 - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dports: - 80 - 443 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.insert: - position: 1 - table: filter - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.insert: - position: 1 - table: filter - family: ipv6 - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.delete: - table: filter - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.delete: - position: 1 - table: filter - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
httpd: iptables.delete: - table: filter - family: ipv6 - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - protocol: tcp - sport: 1025:65535 - save: True
default to accept: iptables.set_policy: - chain: INPUT - policy: ACCEPT
Example rules for IPSec policy: