neulab/tldr huggingface dataset:
onchangeonly: when onchangeonly is True the beacon will fire events only when the service status changes.  Otherwise, it will fire an event at each beacon interval.  The default is False.
delay: when delay is greater than 0 the beacon will fire events only after the service status changes, and the delay (in seconds) has passed.  Applicable only when onchangeonly is True.  The default is 0.
uncleanshutdown: If uncleanshutdown is present it should point to the location of a pid file for the service.  Most services will not clean up this pid file if they are shutdown uncleanly (e.g. via kill -9) or if they are terminated through a crash such as a segmentation fault.  If the file is present, then the beacon will add uncleanshutdown: True to the event.  If not present, the field will be False.  The field is only added when the service is NOT running. Omitting the configuration variable altogether will turn this feature off.
Please note that some init systems can remove the pid file if the service registers as crashed. One such example is nginx on CentOS 7, where the service unit removes the pid file when the service shuts down (IE: the pid file is observed as removed when kill -9 is sent to the nginx master process). The 'uncleanshutdown' option might not be of much use there, unless the unit file is modified.
Here is an example that will fire an event 30 seconds after the state of nginx changes and report an uncleanshutdown.  This example is for Arch, which places nginx's pid file in /run.
beacons: service: - services: nginx: onchangeonly: True delay: 30 uncleanshutdown: /run/nginx.pid
salt.beacons.service.validate(config) Validate the beacon configuration
salt.beacons.sh Watch the shell commands being executed actively. This beacon requires strace.
salt.beacons.sh.beacon(config) Scan the shell execve routines. This beacon will convert all login shells
beacons: sh: []
salt.beacons.sh.validate(config) Validate the beacon configuration
salt.beacons.smartos_imgadm Beacon that fires events on image import/delete.
## minimal # - check for new images every 1 second (salt default) # - does not send events at startup beacons: imgadm: []
## standard # - check for new images every 60 seconds # - send import events at startup for all images beacons: imgadm: - interval: 60 - startup_import_event: True
salt.beacons.smartos_imgadm.beacon(config) Poll imgadm and compare available images
salt.beacons.smartos_imgadm.validate(config) Validate the beacon configuration
salt.beacons.smartos_vmadm Beacon that fires events on vm state changes
## minimal # - check for vm changes every 1 second (salt default) # - does not send events at startup beacons: vmadm: []
## standard # - check for vm changes every 60 seconds # - send create event at startup for all vms beacons: vmadm: - interval: 60 - startup_create_event: True
salt.beacons.smartos_vmadm.beacon(config) Poll vmadm for changes
salt.beacons.smartos_vmadm.validate(config) Validate the beacon configuration
salt.beacons.status The status beacon is intended to send a basic health check event up to the master, this allows for event driven routines based on presence to be set up.
The intention of this beacon is to add the config options to add monitoring stats to the health beacon making it a one stop shop for gathering systems health and status data
To configure this beacon to use the defaults, set up an empty dict for it in the minion config:
beacons: status: []
By default, all of the information from the following execution module functions will be returned:
• loadavg
• cpustats
• meminfo
• vmstats
• time
You can also configure your own set of functions to be returned:
beacons: status: - time: - all - loadavg: - all
You may also configure only certain fields from each function to be returned.  For instance, the loadavg function returns the following fields:
• 1-min
• 5-min
• 15-min
If you wanted to return only the 1-min and 5-min fields for loadavg then you would configure:
beacons: status: - loadavg: - 1-min - 5-min
Other functions only return a single value instead of a dictionary. With these, you may specify all or 0. The following are both valid:
beacons: status: - time: - all
beacons: status: - time: - 0
If a status function returns a list, you may return the index marker or markers for specific list items:
beacons: status: - w: - 0 - 1 - 2
WARNING: Not all status functions are supported for every operating system. Be certain to check the minion log for errors after configuring this beacon.
salt.beacons.status.beacon(config) Return status for requested information
salt.beacons.status.validate(config) Validate the config is a dict
salt.beacons.swapusage Beacon to monitor swap usage.
New in version 3003.
salt.beacons.swapusage.beacon(config) Monitor the swap usage of the minion
beacons: swapusage: - percent: 13%
salt.beacons.swapusage.validate(config) Validate the beacon configuration
salt.beacons.telegram_bot_msg Beacon to emit Telegram messages
Requires the python-telegram-bot library
salt.beacons.telegram_bot_msg.beacon(config) Emit a dict with a key "msgs" whose value is a list of messages sent to the configured bot by one of the allowed usernames.
beacons: telegram_bot_msg: - token: "<bot access token>" - accept_from: - "<valid username>" - interval: 10
salt.beacons.telegram_bot_msg.validate(config) Validate the beacon configuration
salt.beacons.twilio_txt_msg Beacon to emit Twilio text messages
salt.beacons.twilio_txt_msg.beacon(config) Emit a dict name "texts" whose value is a list of texts.
beacons: twilio_txt_msg: - account_sid: "<account sid>" - auth_token: "<auth token>" - twilio_number: "+15555555555" - interval: 10
salt.beacons.twilio_txt_msg.validate(config) Validate the beacon configuration
salt.beacons.watchdog Watch files and translate the changes into salt events.
• watchdog Python module >= 0.8.3
class salt.beacons.watchdog.Handler(queue, masks=None)
on_created(event) Called when a file or directory is created.
Parameters event (DirCreatedEvent or FileCreatedEvent) -- Event representing file/directory creation.
on_deleted(event) Called when a file or directory is deleted.
Parameters event (DirDeletedEvent or FileDeletedEvent) -- Event representing file/directory deletion.
on_modified(event) Called when a file or directory is modified.
Parameters event (DirModifiedEvent or FileModifiedEvent) -- Event representing file/directory modification.
on_moved(event) Called when a file or a directory is moved or renamed.
Parameters event (DirMovedEvent or FileMovedEvent) -- Event representing file/directory movement.
exception salt.beacons.watchdog.ValidationError
salt.beacons.watchdog.beacon(config) Watch the configured directories
beacons: watchdog: - directories: /path/to/dir: mask: - create - modify - delete - move
The mask list can contain the following events (the default mask is create, modify delete, and move): * create  - File or directory is created in watched directory * modify  - The watched directory is modified * delete  - File or directory is deleted from watched directory * move    - File or directory is moved or renamed in the watched directory
salt.beacons.watchdog.close(config)
salt.beacons.watchdog.to_salt_event(event)
salt.beacons.watchdog.validate(config) Validate the beacon configuration
salt.beacons.wtmp Beacon to fire events at login of users as registered in the wtmp file
Example Configuration # Fire events on all logins beacons: wtmp: []
# Matching on user name, using a default time range beacons: wtmp: - users: gareth: - defaults: time_range: start: '8am' end: '4pm'
# Matching on user name, overriding the default time range beacons: wtmp: - users: gareth: time_range: start: '7am' end: '3pm' - defaults: time_range: start: '8am' end: '4pm'
# Matching on group name, overriding the default time range beacons: wtmp: - groups: users: time_range: start: '7am' end: '3pm' - defaults: time_range: start: '8am' end: '4pm'
How to Tell What An Event Means In the events that this beacon fires, a type of 7 denotes a login, while a type of 8 denotes a logout. These values correspond to the ut_type value from a wtmp/utmp event (see the wtmp manpage for more information). In the extremely unlikely case that your platform uses different values, they can be overridden using a ut_type key in the beacon configuration:
beacons: wtmp: - ut_type: login: 9 logout: 10
This beacon's events include an action key which will be either login or logout depending on the event type.
Changed in version 2019.2.0: action key added to beacon event, and ut_type config parameter added.
Use Case: Posting Login/Logout Events to Slack This can be done using the following reactor SLS:
report-wtmp: runner.salt.cmd: - args: - fun: slack.post_message - channel: mychannel      # Slack channel - from_name: someuser     # Slack user - message: "{{ data.get('action', 'Unknown event') | capitalize }} from `{{ data.get('user', '') or 'unknown user' }}` on `{{ data['id'] }}`"
- 'salt/beacon/*/wtmp/': - salt://reactor/wtmp.sls
salt.beacons.wtmp.beacon(config) Read the last wtmp file and return information on the logins
salt.beacons.wtmp.validate(config) Validate the beacon configuration
cache modules For understanding and usage of the cache modules see the cache topic.
┌────────────┬───────────────────────────┐ │consul      │ Minion data cache plugin  │ │            │ for Consul key/value data │ │            │ store.                    │ ├────────────┼───────────────────────────┤ │etcd_cache  │ Minion data cache plugin  │ │            │ for Etcd key/value data   │ │            │ store.                    │ ├────────────┼───────────────────────────┤ │localfs     │ Cache data in filesystem. │ ├────────────┼───────────────────────────┤ │mysql_cache │ Minion data cache plugin  │ │            │ for MySQL database.       │ ├────────────┼───────────────────────────┤ │redis_cache │ Redis                     │ └────────────┴───────────────────────────┘
salt.cache.consul Minion data cache plugin for Consul key/value data store.
New in version 2016.11.2.
depends python-consul >= 0.2.0
It is up to the system administrator to set up and configure the Consul infrastructure. All is needed for this plugin is a working Consul agent with a read-write access to the key-value store.
The related documentation can be found in the Consul documentation.
To enable this cache plugin, the master will need the python client for Consul installed. This can be easily installed with pip:
pip install python-consul
Optionally, depending on the Consul agent configuration, the following values could be set in the master config. These are the defaults:
consul.host: 127.0.0.1 consul.port: 8500 consul.token: None consul.scheme: http consul.consistency: default consul.dc: dc1 consul.verify: True
Related docs could be found in the python-consul documentation.
To use the consul as a minion data cache backend, set the master cache config value to consul:
salt.cache.consul.contains(bank, key) Checks if the specified bank contains the specified key.
salt.cache.consul.fetch(bank, key) Fetch a key value.
salt.cache.consul.flush(bank, key=None) Remove the key from the cache bank with all the key content.
salt.cache.consul.list_(bank) Return an iterable object containing all entries stored in the specified bank.
salt.cache.consul.store(bank, key, data) Store a key value.
salt.cache.etcd_cache Minion data cache plugin for Etcd key/value data store.
It is up to the system administrator to set up and configure the Etcd infrastructure. All is needed for this plugin is a working Etcd agent with a read-write access to the key-value store.
The related documentation can be found in the Etcd documentation.
To enable this cache plugin, the master will need the python client for Etcd installed. This can be easily installed with pip:
pip install python-etcd
Optionally, depending on the Etcd agent configuration, the following values could be set in the master config. These are the defaults:
etcd.host: 127.0.0.1 etcd.port: 2379 etcd.protocol: http etcd.allow_reconnect: True etcd.allow_redirect: False etcd.srv_domain: None etcd.read_timeout: 60 etcd.username: None etcd.password: None etcd.cert: None etcd.ca_cert: None
Related docs could be found in the python-etcd documentation.
To use the etcd as a minion data cache backend, set the master cache config value to etcd:
cache: etcd
salt.cache.etcd_cache.contains(bank, key) Checks if the specified bank contains the specified key.
salt.cache.etcd_cache.fetch(bank, key) Fetch a key value.
salt.cache.etcd_cache.flush(bank, key=None) Remove the key from the cache bank with all the key content.
salt.cache.etcd_cache.ls(bank) Return an iterable object containing all entries stored in the specified bank.
salt.cache.etcd_cache.store(bank, key, data) Store a key value.
salt.cache.localfs Cache data in filesystem.
The localfs Minion cache module is the default cache module and does not require any configuration.
Expiration values can be set in the relevant config file (/etc/salt/master for the master, /etc/salt/cloud for Salt Cloud, etc).
salt.cache.localfs.contains(bank, key, cachedir) Checks if the specified bank contains the specified key.
salt.cache.localfs.fetch(bank, key, cachedir) Fetch information from a file.
salt.cache.localfs.flush(bank, key=None, cachedir=None) Remove the key from the cache bank with all the key content.
salt.cache.localfs.get_storage_id(kwargs)
salt.cache.localfs.init_kwargs(kwargs)
salt.cache.localfs.list_(bank, cachedir) Return an iterable object containing all entries stored in the specified bank.
salt.cache.localfs.store(bank, key, data, cachedir) Store information in a file.
salt.cache.localfs.updated(bank, key, cachedir) Return the epoch of the mtime for this cache file
salt.cache.mysql_cache Minion data cache plugin for MySQL database.
It is up to the system administrator to set up and configure the MySQL infrastructure. All is needed for this plugin is a working MySQL server.
The module requires the salt_cache database to exists but creates its own table if needed. The keys are indexed using the bank and etcd_key columns.
To enable this cache plugin, the master will need the python client for MySQL installed. This can be easily installed with pip:
pip install python-mysql
Optionally, depending on the MySQL agent configuration, the following values could be set in the master config. These are the defaults:
mysql.host: 127.0.0.1 mysql.port: 2379 mysql.user: None mysql.password: None mysql.database: salt_cache mysql.table_name: cache
Related docs could be found in the python-mysql documentation.
To use the mysql as a minion data cache backend, set the master cache config value to mysql:
cache: mysql
salt.cache.mysql_cache.contains(bank, key) Checks if the specified bank contains the specified key.
salt.cache.mysql_cache.fetch(bank, key) Fetch a key value.
salt.cache.mysql_cache.flush(bank, key=None) Remove the key from the cache bank with all the key content.
salt.cache.mysql_cache.ls(bank) Return an iterable object containing all entries stored in the specified bank.
salt.cache.mysql_cache.run_query(conn, query, retries=3, args=None) Get a cursor and run a query. Reconnect up to retries times if needed.  Returns: cursor, affected rows counter Raises: SaltCacheError, AttributeError, OperationalError
salt.cache.mysql_cache.store(bank, key, data) Store a key value.
salt.cache.redis_cache Redis Redis plugin for the Salt caching subsystem.
As Redis provides a simple mechanism for very fast key-value store, in order to provide the necessary features for the Salt caching subsystem, the following conventions are used:
• A Redis key consists of the bank name and the cache key separated by /, e.g.: $KEY_minions/alpha/stuff where minions/alpha is the bank name and stuff is the key name.
• As the caching subsystem is organised as a tree, we need to store the caching path and identify the bank and its offspring.  At the same time, Redis is linear and we need to avoid doing keys <pattern> which is very inefficient as it goes through all the keys on the remote Redis server.  Instead, each bank hierarchy has a Redis SET associated which stores the list of sub-banks. By default, these keys begin with $BANK_.
• In addition, each key name is stored in a separate SET of all the keys within a bank. By default, these SETs begin with $BANKEYS_.
For example, to store the key my-key under the bank root-bank/sub-bank/leaf-bank, the following hierarchy will be built:
127.0.0.1:6379> SMEMBERS $BANK_root-bank 1) "sub-bank" 127.0.0.1:6379> SMEMBERS $BANK_root-bank/sub-bank 1) "leaf-bank" 127.0.0.1:6379> SMEMBERS $BANKEYS_root-bank/sub-bank/leaf-bank 1) "my-key" 127.0.0.1:6379> GET $KEY_root-bank/sub-bank/leaf-bank/my-key "my-value"
There are three types of keys stored:
• $BANK_* is a Redis SET containing the list of banks under the current bank
• $BANKEYS_* is a Redis SET containing the list of keys under the current bank
• $KEY_* keeps the value of the key
These prefixes and the separator can be adjusted using the configuration options:
bank_prefix: $BANK The prefix used for the name of the Redis key storing the list of sub-banks.
bank_keys_prefix: $BANKEYS The prefix used for the name of the Redis keyt storing the list of keys under a certain bank.
key_prefix: $KEY The prefix of the Redis keys having the value of the keys to be cached under a certain bank.
separator: _ The separator between the prefix and the key body.
The connection details can be specified using:
host: localhost The hostname of the Redis server.
port: 6379 The Redis server port.
cache.redis.cluster.startup_nodes - host: redis-member-1 port: 6379 - host: redis-member-2 port: 6379
db: '0' The database index.
NOTE: The database index must be specified as string not as integer value!
password: Redis connection password.
unix_socket_path: New in version 2018.3.1.
Path to a UNIX socket for access. Overrides host / port.
cache.redis.host: localhost cache.redis.port: 6379 cache.redis.db: '0' cache.redis.password: my pass cache.redis.bank_prefix: #BANK cache.redis.bank_keys_prefix: #BANKEYS cache.redis.key_prefix: #KEY cache.redis.separator: '@'
Cluster Configuration Example:
cache.redis.cluster_mode: true cache.redis.cluster.skip_full_coverage_check: true cache.redis.cluster.startup_nodes: - host: redis-member-1 port: 6379 - host: redis-member-2 port: 6379 cache.redis.db: '0' cache.redis.password: my pass cache.redis.bank_prefix: #BANK cache.redis.bank_keys_prefix: #BANKEYS cache.redis.key_prefix: #KEY cache.redis.separator: '@'
salt.cache.redis_cache.contains(bank, key) Checks if the specified bank contains the specified key.
salt.cache.redis_cache.fetch(bank, key) Fetch data from the Redis cache.
salt.cache.redis_cache.flush(bank, key=None) Remove the key from the cache bank with all the key content. If no key is specified, remove the entire bank with all keys and sub-banks inside.  This function is using the Redis pipelining for best performance.  However, when removing a whole bank, in order to re-create the tree, there are a couple of requests made. In total:
• one for node in the hierarchy sub-tree, starting from the bank node
• one pipelined request to get the keys under all banks in the sub-tree
• one pipeline request to remove the corresponding keys
This is not quite optimal, as if we need to flush a bank having a very long list of sub-banks, the number of requests to build the sub-tree may grow quite big.
An improvement for this would be loading a custom Lua script in the Redis instance of the user (using the register_script feature) and call it whenever we flush.  This script would only need to build this sub-tree causing problems. It can be added later and the behaviour should not change as the user needs to explicitly allow Salt inject scripts in their Redis instance.
salt.cache.redis_cache.init_kwargs(kwargs)
salt.cache.redis_cache.list_(bank) Lists entries stored in the specified bank.
salt.cache.redis_cache.store(bank, key, data) Store the data in a Redis key.
salt.cloud.clouds.aliyun AliYun ECS Cloud Module New in version 2014.7.0.
The Aliyun cloud module is used to control access to the aliyun ECS. http://www.aliyun.com/
Use of this module requires the id and key parameter to be set.  Set up the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/aliyun.conf:
my-aliyun-config: # aliyun Access Key ID id: wFGEwgregeqw3435gDger # aliyun Access Key Secret key: GDE43t43REGTrkilg43934t34qT43t4dgegerGEgg location: cn-qingdao driver: aliyun
depends requests
salt.cloud.clouds.aliyun.avail_images(kwargs=None, call=None) Return a list of the images that are on the provider
salt.cloud.clouds.aliyun.avail_locations(call=None) Return a dict of all available VM locations on the cloud provider with relevant data
salt.cloud.clouds.aliyun.avail_sizes(call=None) Return a list of the image sizes that are on the provider
salt.cloud.clouds.aliyun.create(vm_) Create a single VM from a data dict
salt.cloud.clouds.aliyun.create_node(kwargs) Convenience function to make the rest api call for node creation.
salt.cloud.clouds.aliyun.destroy(name, call=None) Destroy a node.
salt-cloud -a destroy myinstance salt-cloud -d myinstance
salt.cloud.clouds.aliyun.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.aliyun.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.aliyun.get_image(vm_) Return the image object to use
salt.cloud.clouds.aliyun.get_location(vm_=None)
Return the aliyun region to use, in this order:
• CLI parameter
• VM parameter
• Cloud profile setting
salt.cloud.clouds.aliyun.get_securitygroup(vm_) Return the security group
salt.cloud.clouds.aliyun.get_size(vm_) Return the VM's size. Used by create_node().
salt.cloud.clouds.aliyun.list_availability_zones(call=None) List all availability zones in the current region
salt.cloud.clouds.aliyun.list_monitor_data(kwargs=None, call=None) Get monitor data of the instance. If instance name is missing, will show all the instance monitor data on the region.
CLI Examples:
salt-cloud -f list_monitor_data aliyun salt-cloud -f list_monitor_data aliyun name=AY14051311071990225bd
salt.cloud.clouds.aliyun.list_nodes(call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.aliyun.list_nodes_full(call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.aliyun.list_nodes_min(call=None) Return a list of the VMs that are on the provider. Only a list of VM names, and their state, is returned. This is the minimum amount of information needed to check for existing VMs.
salt.cloud.clouds.aliyun.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.aliyun.list_securitygroup(call=None) Return a list of security group
salt.cloud.clouds.aliyun.query(params=None) Make a web call to aliyun ECS REST API
salt.cloud.clouds.aliyun.reboot(name, call=None) Reboot a node
salt-cloud -a reboot myinstance
salt.cloud.clouds.aliyun.script(vm_) Return the script deployment object
salt.cloud.clouds.aliyun.show_disk(name, call=None) Show the disk details of the instance
salt-cloud -a show_disk aliyun myinstance
salt.cloud.clouds.aliyun.show_image(kwargs, call=None) Show the details from aliyun image
salt.cloud.clouds.aliyun.show_instance(name, call=None) Show the details from aliyun instance
salt.cloud.clouds.aliyun.start(name, call=None) Start a node
salt-cloud -a start myinstance
salt.cloud.clouds.aliyun.stop(name, force=False, call=None) Stop a node
salt-cloud -a stop myinstance salt-cloud -a stop myinstance force=True
salt.cloud.clouds.azurearm Azure ARM Cloud Module New in version 2016.11.0.
Changed in version 2019.2.0.
The Azure ARM cloud module is used to control access to Microsoft Azure Resource Manager
• azure >= 2.0.0rc6
configuration Required provider parameters:
if using username and password:
• subscription_id
• username
• password
if using a service principal:
• tenant
• client_id
• secret
if using Managed Service Identity authentication:
Optional provider parameters:
cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values:
• AZURE_PUBLIC_CLOUD (default)
• AZURE_CHINA_CLOUD
• AZURE_US_GOV_CLOUD
• AZURE_GERMAN_CLOUD
• HTTP base URL for a custom endpoint, such as Azure Stack. The /metadata/endpoints path will be added to the URL.
userdata and userdata_file: Azure Resource Manager uses a separate VirtualMachineExtension object to pass userdata scripts to the virtual machine. Arbitrary shell commands can be passed via the userdata parameter, or via a file local to the Salt Cloud system using the userdata_file parameter. Note that the local file is not treated as a script by the extension, so "one-liners" probably work best. If greater functionality is desired, a web-hosted script file can be specified via userdata_file: https://raw.githubusercontent.com/account/repo/master/azure-script.py, which will be executed on the system after VM creation. For Windows systems, script files ending in .ps1 will be executed with powershell.exe. The userdata parameter takes precedence over the userdata_file parameter when creating the custom script extension.
win_installer: This parameter, which holds the local path to the Salt Minion installer package, is used to determine if the virtual machine type will be "Windows". Only set this parameter on profiles which install Windows operating systems.
Example /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/azure.conf configuration:
my-azure-config with username and password: driver: azurearm subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617 username: larry password: 123pass
Or my-azure-config with service principal: driver: azurearm subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617 tenant: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF client_id: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF secret: XXXXXXXXXXXXXXXXXXXXXXXX cloud_environment: AZURE_US_GOV_CLOUD
The Service Principal can be created with the new Azure CLI (https://github.com/Azure/azure-cli) with: az ad sp create-for-rbac -n "http://<yourappname>" --role <role> --scopes <scope> For example, this creates a service principal with 'owner' role for the whole subscription: az ad sp create-for-rbac -n "http://mysaltapp" --role owner --scopes /subscriptions/3287abc8-f98a-c678-3bde-326766fd3617
*Note: review the details of Service Principals. Owner role is more than you normally need, and you can restrict scope to a resource group or individual resources.
salt.cloud.clouds.azurearm.avail_images(call=None) Return a dict of all available images on the provider
salt.cloud.clouds.azurearm.avail_locations(call=None) Return a dict of all available regions.
salt.cloud.clouds.azurearm.avail_sizes(call=None) Return a list of sizes available from the provider
salt.cloud.clouds.azurearm.create(vm_) Create a single VM from a data dict.
salt.cloud.clouds.azurearm.create_network_interface(call=None, kwargs=None) Create a network interface.
salt.cloud.clouds.azurearm.create_or_update_vmextension(call=None, kwargs=None) New in version 2019.2.0.
Create or update a VM extension object "inside" of a VM object.
required kwargs:
extension_name: myvmextension virtual_machine_name: myvm settings: {"commandToExecute": "hostname"}
optional kwargs:
resource_group: < inferred from cloud configs > location: < inferred from cloud configs > publisher: < default: Microsoft.Azure.Extensions > virtual_machine_extension_type: < default: CustomScript > type_handler_version: < default: 2.0 > auto_upgrade_minor_version: < default: True > protected_settings: < default: None >
salt.cloud.clouds.azurearm.delete_blob(call=None, kwargs=None) Delete a blob from a container.
salt.cloud.clouds.azurearm.delete_interface(call=None, kwargs=None) Delete a network interface.
salt.cloud.clouds.azurearm.delete_managed_disk(call=None, kwargs=None) Delete a managed disk from a resource group.
salt.cloud.clouds.azurearm.destroy(name, call=None, kwargs=None) Destroy a VM.
salt-cloud -d myminion salt-cloud -a destroy myminion service_name=myservice
salt.cloud.clouds.azurearm.get_api_versions(call=None, kwargs=None) Get a resource type api versions
salt.cloud.clouds.azurearm.get_configured_provider() Return the first configured provider instance.
salt.cloud.clouds.azurearm.get_conn(client_type) Return a connection object for a client type.
salt.cloud.clouds.azurearm.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.azurearm.get_location(call=None, kwargs=None) Return the location that is configured for this provider
salt.cloud.clouds.azurearm.get_resource_by_id(resource_id, api_version, extract_value=None) Get an AzureARM resource by id
salt.cloud.clouds.azurearm.list_blobs(call=None, kwargs=None) List blobs.
salt.cloud.clouds.azurearm.list_nodes(call=None) List VMs on this Azure account
salt.cloud.clouds.azurearm.list_nodes_full(call=None) List all VMs on the subscription with full information
salt.cloud.clouds.azurearm.list_resource_groups(call=None) List resource groups associated with the subscription
salt.cloud.clouds.azurearm.list_storage_accounts(call=None) List storage accounts within the subscription.
salt.cloud.clouds.azurearm.list_subnets(call=None, kwargs=None) List subnets in a virtual network.
salt.cloud.clouds.azurearm.list_virtual_networks(call=None, kwargs=None) List virtual networks.
salt.cloud.clouds.azurearm.request_instance(vm_) Request a VM from Azure.
salt.cloud.clouds.azurearm.show_instance(name, call=None) Show the details from AzureARM concerning an instance
salt.cloud.clouds.azurearm.start(name, call=None) New in version 2019.2.0.
Start a VM
salt-cloud -a start myminion
salt.cloud.clouds.azurearm.stop(name, call=None) New in version 2019.2.0.
Stop (deallocate) a VM
salt-cloud -a stop myminion
salt.cloud.clouds.clc CenturyLink Cloud Module New in version 2018.3.
The CLC cloud module allows you to manage CLC Via the CLC SDK.
codeauthor Stephan Looney <slooney@stephanlooney.com>
Dependencies • clc-sdk Python Module
• flask
CLC SDK clc-sdk can be installed via pip:
pip install clc-sdk
NOTE: For sdk reference see: https://github.com/CenturyLinkCloud/clc-python-sdk
Flask flask can be installed via pip:
pip install flask
Configuration To use this module: set up the clc-sdk, user, password, key in the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/clc.conf:
my-clc-config: driver: clc user: 'web-user' password: 'verybadpass' token: '' token_pass:'' accountalias: 'ACT'
NOTE: The provider parameter in cloud provider configuration was renamed to driver.  This change was made to avoid confusion with the provider parameter that is used in cloud profile configuration. Cloud provider configuration now uses driver to refer to the salt-cloud driver that provides the underlying functionality to connect to a cloud provider, while cloud profile configuration continues to use provider to refer to the cloud provider configuration that you define.
salt.cloud.clouds.clc.avail_images(call=None) returns a list of images available to you
salt.cloud.clouds.clc.avail_locations(call=None) returns a list of locations available to you
salt.cloud.clouds.clc.avail_sizes(call=None) use templates for this
salt.cloud.clouds.clc.create(vm_) get the system build going
salt.cloud.clouds.clc.destroy(name, call=None) destroy the vm
salt.cloud.clouds.clc.get_build_status(req_id, nodename) get the build status from CLC to make sure we don't return to early
salt.cloud.clouds.clc.get_configured_provider()
salt.cloud.clouds.clc.get_creds()
salt.cloud.clouds.clc.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.clc.get_group_estimate(call=None, for_output=True, **kwargs) Return a list of the VMs that are on the provider usage: "salt-cloud -f get_group_estimate clc group=Dev location=VA1"
salt.cloud.clouds.clc.get_month_to_date(call=None, for_output=True) Return a list of the VMs that are on the provider
salt.cloud.clouds.clc.get_monthly_estimate(call=None, for_output=True) Return a list of the VMs that are on the provider
salt.cloud.clouds.clc.get_queue_data(call=None, for_output=True)
salt.cloud.clouds.clc.get_server_alerts(call=None, for_output=True, **kwargs) Return a list of alerts from CLC as reported by their infra
salt.cloud.clouds.clc.list_nodes_full(call=None, for_output=True) Return a list of the VMs that are on the provider
salt.cloud.clouds.cloudstack CloudStack Cloud Module The CloudStack cloud module is used to control access to a CloudStack based Public Cloud.
depends libcloud >= 0.15
Use of this module requires the apikey, secretkey, host and path parameters.
my-cloudstack-cloud-config: apikey: <your api key > secretkey: <your secret key > host: localhost path: /client/api driver: cloudstack
salt.cloud.clouds.cloudstack.avail_images(conn=None, call=None) Return a dict of all available VM images on the cloud provider with relevant data
salt.cloud.clouds.cloudstack.avail_locations(conn=None, call=None) Return a dict of all available VM locations on the cloud provider with relevant data
salt.cloud.clouds.cloudstack.avail_sizes(conn=None, call=None) Return a dict of all available VM images on the cloud provider with relevant data
salt.cloud.clouds.cloudstack.block_device_mappings(vm_) Return the block device mapping:
[{'DeviceName': '/dev/sdb', 'VirtualName': 'ephemeral0'}, {'DeviceName': '/dev/sdc', 'VirtualName': 'ephemeral1'}]
salt.cloud.clouds.cloudstack.cloudstack_displayname(vm_) Return display name of VM:
::     "minion1"
salt.cloud.clouds.cloudstack.create(vm_) Create a single VM from a data dict
salt.cloud.clouds.cloudstack.destroy(name, conn=None, call=None) Delete a single VM, and all of its volumes
salt.cloud.clouds.cloudstack.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.cloudstack.get_conn() Return a conn object for the passed VM data
salt.cloud.clouds.cloudstack.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.cloudstack.get_image(conn, vm_) Return the image object to use
salt.cloud.clouds.cloudstack.get_ip(data) Return the IP address of the VM If the VM has  public IP as defined by libcloud module then use it Otherwise try to extract the private IP and use that one.
salt.cloud.clouds.cloudstack.get_key() Returns the ssh private key for VM access
salt.cloud.clouds.cloudstack.get_keypair(vm_) Return the keypair to use
salt.cloud.clouds.cloudstack.get_location(conn, vm_) Return the node location to use
salt.cloud.clouds.cloudstack.get_networkid(vm_) Return the networkid to use, only valid for Advanced Zone
salt.cloud.clouds.cloudstack.get_node(conn, name) Return a libcloud node for the named VM
salt.cloud.clouds.cloudstack.get_password(vm_) Return the password to use
salt.cloud.clouds.cloudstack.get_project(conn, vm_) Return the project to use.
salt.cloud.clouds.cloudstack.get_security_groups(conn, vm_) Return a list of security groups to use, defaulting to ['default']
salt.cloud.clouds.cloudstack.get_size(conn, vm_) Return the VM's size object
salt.cloud.clouds.cloudstack.list_nodes(conn=None, call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.cloudstack.list_nodes_full(conn=None, call=None) Return a list of the VMs that are on the provider, with all fields
salt.cloud.clouds.cloudstack.list_nodes_select(conn=None, call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.cloudstack.script(vm_) Return the script deployment object
salt.cloud.clouds.cloudstack.show_instance(name, call=None) Show the details from the provider concerning an instance
salt.cloud.clouds.digitalocean DigitalOcean Cloud Module The DigitalOcean cloud module is used to control access to the DigitalOcean VPS system.
Use of this module requires a requires a personal_access_token, an ssh_key_file, and at least one SSH key name in ssh_key_names. More ssh_key_names can be added by separating each key with a comma. The personal_access_token can be found in the DigitalOcean web interface in the "Apps & API" section. The SSH key name can be found under the "SSH Keys" section.
my-digital-ocean-config: personal_access_token: xxx ssh_key_file: /path/to/ssh/key/file ssh_key_names: my-key-name,my-key-name-2 driver: digitalocean
salt.cloud.clouds.digitalocean.assign_floating_ip(kwargs=None, call=None) Assign a floating IP
salt-cloud -f assign_floating_ip my-digitalocean-config droplet_id=1234567 floating_ip='45.55.96.47'
salt.cloud.clouds.digitalocean.avail_images(call=None) Return a list of the images that are on the provider
salt.cloud.clouds.digitalocean.avail_locations(call=None) Return a dict of all available VM locations on the cloud provider with relevant data
salt.cloud.clouds.digitalocean.avail_sizes(call=None) Return a list of the image sizes that are on the provider
salt.cloud.clouds.digitalocean.create(vm_) Create a single VM from a data dict
salt.cloud.clouds.digitalocean.create_floating_ip(kwargs=None, call=None) Create a new floating IP
salt-cloud -f create_floating_ip my-digitalocean-config region='NYC2'
salt-cloud -f create_floating_ip my-digitalocean-config droplet_id='1234567'
salt.cloud.clouds.digitalocean.create_key(kwargs=None, call=None) Upload a public key
salt.cloud.clouds.digitalocean.create_node(args) Create a node
salt.cloud.clouds.digitalocean.delete_floating_ip(kwargs=None, call=None) Delete a floating IP
salt-cloud -f delete_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt.cloud.clouds.digitalocean.destroy(name, call=None) Destroy a node. Will check termination protection and warn if enabled.
salt-cloud --destroy mymachine
salt.cloud.clouds.digitalocean.destroy_dns_records(fqdn) Deletes DNS records for the given hostname if the domain is managed with DO.
salt.cloud.clouds.digitalocean.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.digitalocean.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.digitalocean.get_image(vm_) Return the image object to use
salt.cloud.clouds.digitalocean.get_keyid(keyname) Return the ID of the keyname
salt.cloud.clouds.digitalocean.get_location(vm_) Return the VM's location
salt.cloud.clouds.digitalocean.get_size(vm_) Return the VM's size. Used by create_node().
salt.cloud.clouds.digitalocean.import_keypair(kwargs=None, call=None) Upload public key to cloud provider.  Similar to EC2 import_keypair.
kwargs file(mandatory): public key file-name keyname(mandatory): public key name in the provider
salt.cloud.clouds.digitalocean.list_floating_ips(call=None) Return a list of the floating ips that are on the provider
salt-cloud -f list_floating_ips my-digitalocean-config
salt.cloud.clouds.digitalocean.list_keypairs(call=None) Return a dict of all available VM locations on the cloud provider with relevant data
salt.cloud.clouds.digitalocean.list_nodes(call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.digitalocean.list_nodes_full(call=None, for_output=True) Return a list of the VMs that are on the provider
salt.cloud.clouds.digitalocean.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.digitalocean.post_dns_record(**kwargs) Creates a DNS record for the given name if the domain is managed with DO.
salt.cloud.clouds.digitalocean.query(method='droplets', droplet_id=None, command=None, args=None, http_method='get') Make a web call to DigitalOcean
salt.cloud.clouds.digitalocean.reboot(name, call=None) Reboot a droplet in DigitalOcean.
New in version 2015.8.8.
name   The name of the droplet to restart.
salt-cloud -a reboot droplet_name
salt.cloud.clouds.digitalocean.remove_key(kwargs=None, call=None) Delete public key
salt.cloud.clouds.digitalocean.script(vm_) Return the script deployment object
salt.cloud.clouds.digitalocean.show_floating_ip(kwargs=None, call=None) Show the details of a floating IP
salt-cloud -f show_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt.cloud.clouds.digitalocean.show_instance(name, call=None) Show the details from DigitalOcean concerning a droplet
salt.cloud.clouds.digitalocean.show_keypair(kwargs=None, call=None) Show the details of an SSH keypair
salt.cloud.clouds.digitalocean.show_pricing(kwargs=None, call=None) Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources.
salt-cloud -f show_pricing my-digitalocean-config profile=my-profile
salt.cloud.clouds.digitalocean.start(name, call=None) Start a droplet in DigitalOcean.
name   The name of the droplet to start.
salt-cloud -a start droplet_name
salt.cloud.clouds.digitalocean.stop(name, call=None) Stop a droplet in DigitalOcean.
name   The name of the droplet to stop.
salt-cloud -a stop droplet_name
salt.cloud.clouds.digitalocean.unassign_floating_ip(kwargs=None, call=None) Unassign a floating IP
salt-cloud -f unassign_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt.cloud.clouds.dimensiondata Dimension Data Cloud Module This is a cloud module for the Dimension Data Cloud, using the existing Libcloud driver for Dimension Data.
# Note: This example is for /etc/salt/cloud.providers # or any file in the # /etc/salt/cloud.providers.d/ directory.
maintainer Anthony Shaw <anthonyshaw@apache.org>
depends libcloud >= 1.2.1
salt.cloud.clouds.dimensiondata.avail_images(conn=None, call=None) Return a dict of all available VM images on the cloud provider with relevant data
salt.cloud.clouds.dimensiondata.avail_locations(conn=None, call=None) Return a dict of all available VM locations on the cloud provider with relevant data
salt.cloud.clouds.dimensiondata.avail_sizes(conn=None, call=None) Return a dict of all available VM images on the cloud provider with relevant data
salt.cloud.clouds.dimensiondata.create(vm_) Create a single VM from a data dict
salt.cloud.clouds.dimensiondata.create_lb(kwargs=None, call=None) Create a load-balancer configuration.
salt-cloud -f create_lb dimensiondata \ name=dev-lb port=80 protocol=http \ members=w1,w2,w3 algorithm=ROUND_ROBIN
salt.cloud.clouds.dimensiondata.destroy(name, conn=None, call=None) Delete a single VM
salt.cloud.clouds.dimensiondata.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.dimensiondata.get_conn() Return a conn object for the passed VM data
salt.cloud.clouds.dimensiondata.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.dimensiondata.get_image(conn, vm_) Return the image object to use
salt.cloud.clouds.dimensiondata.get_lb_conn(dd_driver=None) Return a load-balancer conn object
salt.cloud.clouds.dimensiondata.get_node(conn, name) Return a libcloud node for the named VM
salt.cloud.clouds.dimensiondata.get_size(conn, vm_) Return the VM's size object
salt.cloud.clouds.dimensiondata.list_nodes(conn=None, call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.dimensiondata.list_nodes_full(conn=None, call=None) Return a list of the VMs that are on the provider, with all fields
salt.cloud.clouds.dimensiondata.list_nodes_select(conn=None, call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.dimensiondata.preferred_ip(vm_, ips) Return the preferred Internet protocol. Either 'ipv4' (default) or 'ipv6'.
salt.cloud.clouds.dimensiondata.reboot(name, conn=None) Reboot a single VM
salt.cloud.clouds.dimensiondata.script(vm_) Return the script deployment object
salt.cloud.clouds.dimensiondata.show_instance(name, call=None) Show the details from the provider concerning an instance
salt.cloud.clouds.dimensiondata.ssh_interface(vm_) Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.
salt.cloud.clouds.dimensiondata.start(name, call=None) Stop a VM in DimensionData.
Parameters name (str) -- The name of the VM to stop.
salt-cloud -a stop vm_name
salt.cloud.clouds.dimensiondata.stop(name, call=None) Stop a VM in DimensionData.
name:  The name of the VM to stop.
salt.cloud.clouds.ec2 The EC2 Cloud Module The EC2 cloud module is used to interact with the Amazon Elastic Compute Cloud.
To use the EC2 cloud module, set up the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/ec2.conf:
my-ec2-config: # EC2 API credentials: Access Key ID and Secret Access Key. # Alternatively, to use IAM Instance Role credentials available via # EC2 metadata set both id and key to 'use-instance-role-credentials' id: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# The ssh keyname to use keyname: default # The amazon security group securitygroup: ssh_open # The location of the private key which corresponds to the keyname private_key: /root/default.pem
# Be default, service_url is set to amazonaws.com. If you are using this # driver for something other than Amazon EC2, change it here: service_url: amazonaws.com
# The endpoint that is ultimately used is usually formed using the region # and the service_url. If you would like to override that entirely, you # can explicitly define the endpoint: endpoint: myendpoint.example.com:1138/services/Cloud
# SSH Gateways can be used with this provider. Gateways can be used # when a salt-master is not on the same private network as the instance # that is being deployed.
# Defaults to None # Required ssh_gateway: gateway.example.com
# Defaults to port 22 # Optional ssh_gateway_port: 22
# Defaults to root # Optional ssh_gateway_username: root
# Default to nc -q0 %h %p # Optional ssh_gateway_command: "-W %h:%p"
# One authentication method is required. If both # are specified, Private key wins.
# Private key defaults to None ssh_gateway_private_key: /path/to/key.pem
# Password defaults to None ssh_gateway_password: ExamplePasswordHere
# Pass userdata to the instance to be created userdata_file: /etc/salt/my-userdata-file
# Instance termination protection setting # Default is disabled termination_protection: False
salt.cloud.clouds.ec2.attach_volume(name=None, kwargs=None, instance_id=None, call=None) Attach a volume to an instance
salt.cloud.clouds.ec2.avail_images(kwargs=None, call=None) Return a dict of all available VM images on the cloud provider.
salt.cloud.clouds.ec2.avail_locations(call=None) List all available locations
salt.cloud.clouds.ec2.avail_sizes(call=None) Return a dict of all available VM sizes on the cloud provider with relevant data. Latest version can be found at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html
salt.cloud.clouds.ec2.block_device_mappings(vm_) Return the block device mapping:
salt.cloud.clouds.ec2.copy_snapshot(kwargs=None, call=None) Copy a snapshot
salt.cloud.clouds.ec2.create(vm_=None, call=None) Create a single VM from a data dict
salt.cloud.clouds.ec2.create_attach_volumes(name, kwargs, call=None, wait_to_finish=True) Create and attach volumes to created node
salt.cloud.clouds.ec2.create_keypair(kwargs=None, call=None) Create an SSH keypair
salt.cloud.clouds.ec2.create_snapshot(kwargs=None, call=None, wait_to_finish=False) Create a snapshot.
volume_id The ID of the Volume from which to create a snapshot.
description The optional description of the snapshot.
CLI Exampe:
salt-cloud -f create_snapshot my-ec2-config volume_id=vol-351d8826 salt-cloud -f create_snapshot my-ec2-config volume_id=vol-351d8826 \ description="My Snapshot Description"
salt.cloud.clouds.ec2.create_volume(kwargs=None, call=None, wait_to_finish=False) Create a volume.
zone   The availability zone used to create the volume. Required. String.
size   The size of the volume, in GiBs. Defaults to 10. Integer.
snapshot The snapshot-id from which to create the volume. Integer.
type   The volume type. This can be gp2 for General Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes. String.
iops   The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 50 IOPS/GiB. Only valid for Provisioned IOPS SSD volumes. Integer.
This option will only be set if type is also specified as io1 or io2
encrypted Specifies whether the volume will be encrypted. Boolean.
If snapshot is also given in the list of kwargs, then this value is ignored since volumes that are created from encrypted snapshots are also automatically encrypted.
tags   The tags to apply to the volume during creation. Dictionary.
call   The create_volume function must be called with -f or --function.  String.
wait_to_finish Whether or not to wait for the volume to be available. Boolean. Defaults to False.
salt-cloud -f create_volume my-ec2-config zone=us-east-1b salt-cloud -f create_volume my-ec2-config zone=us-east-1b tags='{"tag1": "val1", "tag2", "val2"}'