neulab/tldr huggingface dataset:
Search and connection options can be overridden by specifying the relevant option as key=value pairs, for example:
salt 'ldaphost' ldap.search filter=cn=myhost dn=ou=hosts,o=acme,c=gb scope=1 attrs='' server='localhost' port='7393' tls=True bindpw='ssh'
salt.modules.libcloud_compute Apache Libcloud Compute Management Connection module for Apache Libcloud Compute management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/latest/compute/supported_providers.html
Clouds include Amazon EC2, Azure, Google GCE, VMware, OpenStack Nova
configuration This module uses a configuration profile for one or multiple cloud providers
libcloud_compute: profile_test1: driver: google key: service-account@googlecloud.net secret: /path/to.key.json profile_test2: driver: arm key: 12345 secret: mysecret
depends apache-libcloud
salt.modules.libcloud_compute.attach_volume(node_id, volume_id, profile, device=None, **libcloud_kwargs) Attaches volume to node.
• node_id (str) -- Node ID to target
• volume_id (str) -- Volume ID from which to attach
• profile (str) -- The profile key
• device (str) -- Where the device is exposed, e.g. '/dev/sdb'
• libcloud_kwargs (dict) -- Extra arguments for the driver's attach_volume method
salt myminion libcloud_compute.detach_volume vol1 profile1
salt.modules.libcloud_compute.copy_image(source_region, image_id, name, profile, description=None, **libcloud_kwargs) Copies an image from a source region to the current region.
• source_region (str) -- Region to copy the node from.
• image_id (str) -- Image to copy.
• name (str) -- name for new image.
• description -- description for new image.
• libcloud_kwargs (dict) -- Extra arguments for the driver's copy_image method
salt myminion libcloud_compute.copy_image us-east1 image1 'new image' profile1
salt.modules.libcloud_compute.create_image(node_id, name, profile, description=None, **libcloud_kwargs) Create an image from a node
• node_id (str) -- Node to run the task on.
• description (description) -- description for new image.
• libcloud_kwargs (dict) -- Extra arguments for the driver's create_image method
salt myminion libcloud_compute.create_image server1 my_image profile1 salt myminion libcloud_compute.create_image server1 my_image profile1 description='test image'
salt.modules.libcloud_compute.create_key_pair(name, profile, **libcloud_kwargs) Create a single key pair by name
• name (str) -- Name of the key pair to create.
• libcloud_kwargs (dict) -- Extra arguments for the driver's create_key_pair method
salt myminion libcloud_compute.create_key_pair pair1 profile1
salt.modules.libcloud_compute.create_volume(size, name, profile, location_id=None, **libcloud_kwargs) Create a storage volume
• size (int) -- Size of volume in gigabytes (required)
• name (str) -- Name of the volume to be created
• location_id (str) -- Which data center to create a volume in. If empty, undefined behavior will be selected. (optional)
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_volumes method
salt myminion libcloud_compute.create_volume 1000 vol1 profile1
salt.modules.libcloud_compute.create_volume_snapshot(volume_id, profile, name=None, **libcloud_kwargs) Create a storage volume snapshot
• volume_id (str) -- Volume ID from which to create the new snapshot.
• name (str) -- Name of the snapshot to be created (optional)
• libcloud_kwargs (dict) -- Extra arguments for the driver's create_volume_snapshot method
salt myminion libcloud_compute.create_volume_snapshot vol1 profile1
salt.modules.libcloud_compute.delete_image(image_id, profile, **libcloud_kwargs) Delete an image of a node
• image_id (str) -- Image to delete
• libcloud_kwargs (dict) -- Extra arguments for the driver's delete_image method
salt myminion libcloud_compute.delete_image image1 profile1
salt.modules.libcloud_compute.delete_key_pair(name, profile, **libcloud_kwargs) Delete a key pair
• name (str) -- Key pair name.
• libcloud_kwargs (dict) -- Extra arguments for the driver's import_key_pair_from_xxx method
salt myminion libcloud_compute.delete_key_pair pair1 profile1
salt.modules.libcloud_compute.destroy_node(node_id, profile, **libcloud_kwargs) Destroy a node in the cloud
• node_id (str) -- Unique ID of the node to destroy
• libcloud_kwargs (dict) -- Extra arguments for the driver's destroy_node method
salt myminion libcloud_compute.destry_node as-2346 profile1
salt.modules.libcloud_compute.destroy_volume(volume_id, profile, **libcloud_kwargs) Destroy a volume.
• volume_id (str) -- Volume ID from which to destroy
• libcloud_kwargs (dict) -- Extra arguments for the driver's destroy_volume method
salt myminion libcloud_compute.destroy_volume vol1 profile1
salt.modules.libcloud_compute.destroy_volume_snapshot(volume_id, snapshot_id, profile, **libcloud_kwargs) Destroy a volume snapshot.
• volume_id (str) -- Volume ID from which the snapshot belongs
• snapshot_id (str) -- Volume Snapshot ID from which to destroy
• libcloud_kwargs (dict) -- Extra arguments for the driver's destroy_volume_snapshot method
salt myminion libcloud_compute.destroy_volume_snapshot snap1 profile1
salt.modules.libcloud_compute.detach_volume(volume_id, profile, **libcloud_kwargs) Detaches a volume from a node.
• volume_id (str) -- Volume ID from which to detach
• libcloud_kwargs (dict) -- Extra arguments for the driver's detach_volume method
salt.modules.libcloud_compute.extra(method, profile, **libcloud_kwargs) Call an extended method on the driver
• method (str) -- Driver's method name
• libcloud_kwargs (dict) -- Extra arguments for the driver's method
salt myminion libcloud_compute.extra ex_get_permissions google container_name=my_container object_name=me.jpg --out=yaml
salt.modules.libcloud_compute.get_image(image_id, profile, **libcloud_kwargs) Get an image of a node
• image_id (str) -- Image to fetch
salt myminion libcloud_compute.get_image image1 profile1
salt.modules.libcloud_compute.get_key_pair(name, profile, **libcloud_kwargs) Get a single key pair by name
• name (str) -- Name of the key pair to retrieve.
• libcloud_kwargs (dict) -- Extra arguments for the driver's get_key_pair method
salt myminion libcloud_compute.get_key_pair pair1 profile1
salt.modules.libcloud_compute.import_key_pair(name, key, profile, key_type=None, **libcloud_kwargs) Import a new public key from string or a file path
• key (str or path str) -- Public key material, the string or a path to a file
• key_type (str) -- The key pair type, either FILE or STRING. Will detect if not provided and assume that if the string is a path to an existing path it is a FILE, else STRING.
salt myminion libcloud_compute.import_key_pair pair1 key_value_data123 profile1 salt myminion libcloud_compute.import_key_pair pair1 /path/to/key profile1
salt.modules.libcloud_compute.list_images(profile, location_id=None, **libcloud_kwargs) Return a list of images for this cloud
• location_id (str) -- The location key, from list_locations
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_images method
salt myminion libcloud_compute.list_images profile1
salt.modules.libcloud_compute.list_key_pairs(profile, **libcloud_kwargs) List all the available key pair objects.
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_key_pairs method
salt myminion libcloud_compute.list_key_pairs profile1
salt.modules.libcloud_compute.list_locations(profile, **libcloud_kwargs) Return a list of locations for this cloud
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_locations method
salt myminion libcloud_compute.list_locations profile1
salt.modules.libcloud_compute.list_nodes(profile, **libcloud_kwargs) Return a list of nodes
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_nodes method
salt myminion libcloud_compute.list_nodes profile1
salt.modules.libcloud_compute.list_sizes(profile, location_id=None, **libcloud_kwargs) Return a list of node sizes
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_sizes method
salt myminion libcloud_compute.list_sizes profile1 salt myminion libcloud_compute.list_sizes profile1 us-east1
salt.modules.libcloud_compute.list_volume_snapshots(volume_id, profile, **libcloud_kwargs) Return a list of storage volumes snapshots for this cloud
• volume_id (str) -- The volume identifier
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_volume_snapshots method
salt myminion libcloud_compute.list_volume_snapshots vol1 profile1
salt.modules.libcloud_compute.list_volumes(profile, **libcloud_kwargs) Return a list of storage volumes for this cloud
salt myminion libcloud_compute.list_volumes profile1
salt.modules.libcloud_compute.reboot_node(node_id, profile, **libcloud_kwargs) Reboot a node in the cloud
• node_id (str) -- Unique ID of the node to reboot
• libcloud_kwargs (dict) -- Extra arguments for the driver's reboot_node method
salt myminion libcloud_compute.reboot_node as-2346 profile1
salt.modules.libcloud_dns Apache Libcloud DNS Management Connection module for Apache Libcloud DNS management
configuration This module uses a configuration profile for one or multiple DNS providers
libcloud_dns: profile_test1: driver: cloudflare key: 12345 secret: mysecret profile_test2: driver: godaddy key: 12345 secret: mysecret shopper_id: 12345
salt.modules.libcloud_dns.create_record(name, zone_id, type, data, profile) Create a new record.
• name (str) -- Record name without the domain name (e.g. www).  Note: If you want to create a record for a base domain name, you should specify empty string ('') for this argument.
• zone_id (str) -- Zone where the requested record is created.
• type (str) -- DNS record type (A, AAAA, ...).
• data (str) -- Data for the record (depends on the record type).
salt myminion libcloud_dns.create_record www google.com A 12.32.12.2 profile1
salt.modules.libcloud_dns.create_zone(domain, profile, type='master', ttl=None) Create a new zone.
• domain (str) -- Zone domain name (e.g. example.com)
• type (str) -- Zone type (master / slave).
• ttl (int) -- TTL for new records. (optional)
salt myminion libcloud_dns.create_zone google.com profile1
salt.modules.libcloud_dns.delete_record(zone_id, record_id, profile) Delete a record.
• zone_id (str) -- Zone to delete.
• record_id (str) -- Record to delete.
salt myminion libcloud_dns.delete_record google.com www profile1
salt.modules.libcloud_dns.delete_zone(zone_id, profile) Delete a zone.
salt myminion libcloud_dns.delete_zone google.com profile1
salt.modules.libcloud_dns.extra(method, profile, **libcloud_kwargs) Call an extended method on the driver
• libcloud_kwargs (dict) -- Extra arguments for the driver's delete_container method
salt myminion libcloud_dns.extra ex_get_permissions google container_name=my_container object_name=me.jpg --out=yaml
salt.modules.libcloud_dns.get_bind_data(zone_id, profile) Export Zone to the BIND compatible format.
• zone_id (str) -- Zone to export.
Returns Zone data in BIND compatible format.
salt myminion libcloud_dns.get_bind_data google.com profile1
salt.modules.libcloud_dns.get_record(zone_id, record_id, profile) Get record information for the given zone_id on the given profile
salt myminion libcloud_dns.get_record google.com www profile1
salt.modules.libcloud_dns.get_zone(zone_id, profile) Get zone information for the given zone_id on the given profile
salt myminion libcloud_dns.get_zone google.com profile1
salt.modules.libcloud_dns.list_record_types(profile) List available record types for the given profile, e.g. A, AAAA
Parameters profile (str) -- The profile key
salt myminion libcloud_dns.list_record_types profile1
salt.modules.libcloud_dns.list_records(zone_id, profile, type=None) List records for the given zone_id on the given profile
• type (str) -- The record type, e.g. A, NS
salt myminion libcloud_dns.list_records google.com profile1
salt.modules.libcloud_dns.list_zones(profile) List zones for the given profile
salt myminion libcloud_dns.list_zones profile1
salt.modules.libcloud_dns.update_zone(zone_id, domain, profile, type='master', ttl=None) Update an existing zone.
• zone_id (str) -- Zone ID to update.
salt myminion libcloud_dns.update_zone google.com google.com profile1 type=slave
salt.modules.libcloud_loadbalancer Apache Libcloud Load Balancer Management Connection module for Apache Libcloud Storage load balancer management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/latest/loadbalancer/supported_providers.html
Clouds include Amazon ELB, ALB, Google, Aliyun, CloudStack, Softlayer
configuration This module uses a configuration profile for one or multiple Storage providers
libcloud_loadbalancer: profile_test1: driver: gce key: GOOG0123456789ABCXYZ secret: mysecret profile_test2: driver: alb key: 12345 secret: mysecret
salt.modules.libcloud_loadbalancer.balancer_attach_member(balancer_id, ip, port, profile, extra=None, **libcloud_kwargs) Add a new member to the load balancer
• balancer_id (str) -- id of a load balancer you want to fetch
• ip (str) -- IP address for the new member
• port (int) -- Port for the new member
• libcloud_kwargs (dict) -- Extra arguments for the driver's balancer_attach_member method
salt myminion libcloud_storage.balancer_attach_member balancer123 1.2.3.4 80 profile1
salt.modules.libcloud_loadbalancer.balancer_detach_member(balancer_id, member_id, profile, **libcloud_kwargs) Add a new member to the load balancer
• libcloud_kwargs (dict) -- Extra arguments for the driver's balancer_detach_member method
salt myminion libcloud_storage.balancer_detach_member balancer123 member123 profile1
salt.modules.libcloud_loadbalancer.create_balancer(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs) Create a new load balancer instance
• name (str) -- Name of the new load balancer (required)
• port (str) -- Port the load balancer should listen on, defaults to 80
• protocol (str) -- Loadbalancer protocol, defaults to http.
• algorithm (str) -- Load balancing algorithm, defaults to ROUND_ROBIN. See Algorithm type in Libcloud documentation for a full listing.
• libcloud_kwargs (dict) -- Extra arguments for the driver's create_balancer method
Returns The details of the new balancer
salt myminion libcloud_storage.create_balancer my_balancer 80 http profile1
salt.modules.libcloud_loadbalancer.destroy_balancer(balancer_id, profile, **libcloud_kwargs) Destroy a load balancer
• balancer_id (str) -- LoadBalancer ID which should be used
• libcloud_kwargs (dict) -- Extra arguments for the driver's destroy_balancer method
Returns True if the destroy was successful, otherwise False.
salt myminion libcloud_storage.destroy_balancer balancer_1 profile1
salt.modules.libcloud_loadbalancer.extra(method, profile, **libcloud_kwargs) Call an extended method on the driver
salt myminion libcloud_loadbalancer.extra ex_get_permissions google container_name=my_container object_name=me.jpg --out=yaml
salt.modules.libcloud_loadbalancer.get_balancer(balancer_id, profile, **libcloud_kwargs) Get the details for a load balancer by ID
• libcloud_kwargs (dict) -- Extra arguments for the driver's get_balancer method
Returns the load balancer details
salt myminion libcloud_storage.get_balancer balancer123 profile1
salt.modules.libcloud_loadbalancer.get_balancer_by_name(name, profile, **libcloud_kwargs) Get the details for a load balancer by name
• name (str) -- Name of a load balancer you want to fetch
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_balancers method
salt myminion libcloud_storage.get_balancer_by_name my_balancer profile1
salt.modules.libcloud_loadbalancer.list_balancer_members(balancer_id, profile, **libcloud_kwargs) List the members of a load balancer
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_balancer_members method
salt myminion libcloud_storage.list_balancer_members balancer123 profile1
salt.modules.libcloud_loadbalancer.list_balancers(profile, **libcloud_kwargs) Return a list of load balancers.
salt myminion libcloud_storage.list_balancers profile1
salt.modules.libcloud_loadbalancer.list_protocols(profile, **libcloud_kwargs) Return a list of supported protocols.
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_protocols method
Returns a list of supported protocols
salt myminion libcloud_storage.list_protocols profile1
salt.modules.libcloud_loadbalancer.list_supported_algorithms(profile, **libcloud_kwargs) Get the supported algorithms for a profile
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_supported_algorithms method
Returns The supported algorithms
salt myminion libcloud_storage.list_supported_algorithms profile1
salt.modules.libcloud_storage Apache Libcloud Storage Management Connection module for Apache Libcloud Storage (object/blob) management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/latest/storage/supported_providers.html
Clouds include Amazon S3, Google Storage, Aliyun, Azure Blobs, Ceph, OpenStack swift
libcloud_storage: profile_test1: driver: google_storage key: GOOG0123456789ABCXYZ secret: mysecret profile_test2: driver: s3 key: 12345 secret: mysecret
salt.modules.libcloud_storage.create_container(container_name, profile, **libcloud_kwargs) Create a container in the cloud
• container_name (str) -- Container name
• libcloud_kwargs (dict) -- Extra arguments for the driver's create_container method
salt myminion libcloud_storage.create_container MyFolder profile1
salt.modules.libcloud_storage.delete_container(container_name, profile, **libcloud_kwargs) Delete an object container in the cloud
Returns True if an object container has been successfully deleted, False otherwise.
salt myminion libcloud_storage.delete_container MyFolder profile1
salt.modules.libcloud_storage.delete_object(container_name, object_name, profile, **libcloud_kwargs) Delete an object in the cloud
• object_name (str) -- Object name
• libcloud_kwargs (dict) -- Extra arguments for the driver's delete_object method
Returns True if an object has been successfully deleted, False otherwise.
salt myminion libcloud_storage.delete_object MyFolder me.jpg profile1
salt.modules.libcloud_storage.download_object(container_name, object_name, destination_path, profile, overwrite_existing=False, delete_on_failure=True, **libcloud_kwargs) Download an object to the specified destination path.
• destination_path (str) -- Full path to a file or a directory where the incoming file will be saved.
• overwrite_existing (bool) -- True to overwrite an existing file, defaults to False.
• delete_on_failure (bool) -- True to delete a partially downloaded file if the download was not successful (hash mismatch / file size).
• libcloud_kwargs (dict) -- Extra arguments for the driver's download_object method
Returns True if an object has been successfully downloaded, False otherwise.
salt myminion libcloud_storage.download_object MyFolder me.jpg /tmp/me.jpg profile1
salt.modules.libcloud_storage.extra(method, profile, **libcloud_kwargs) Call an extended method on the driver
salt myminion libcloud_storage.extra ex_get_permissions google container_name=my_container object_name=me.jpg --out=yaml
salt.modules.libcloud_storage.get_container(container_name, profile, **libcloud_kwargs) List container details for the given container_name on the given profile
• libcloud_kwargs (dict) -- Extra arguments for the driver's get_container method
salt myminion libcloud_storage.get_container MyFolder profile1
salt.modules.libcloud_storage.get_container_object(container_name, object_name, profile, **libcloud_kwargs) Get the details for a container object (file or object in the cloud)
• libcloud_kwargs (dict) -- Extra arguments for the driver's get_container_object method
salt myminion libcloud_storage.get_container_object MyFolder MyFile.xyz profile1
salt.modules.libcloud_storage.list_container_objects(container_name, profile, **libcloud_kwargs) List container objects (e.g. files) for the given container_id on the given profile
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_container_objects method
salt myminion libcloud_storage.list_container_objects MyFolder profile1
salt.modules.libcloud_storage.list_containers(profile, **libcloud_kwargs) Return a list of containers.
• libcloud_kwargs (dict) -- Extra arguments for the driver's list_containers method
salt myminion libcloud_storage.list_containers profile1
salt.modules.libcloud_storage.upload_object(file_path, container_name, object_name, profile, extra=None, verify_hash=True, headers=None, **libcloud_kwargs) Upload an object currently located on a disk.
• file_path (str) -- Path to the object on disk.
• container_name (str) -- Destination container.
• object_name (str) -- Object name.
• verify_hash (bool) -- Verify hash
• extra (dict) -- Extra attributes (driver specific). (optional)
• headers (dict) -- (optional) Additional request headers, such as CORS headers. For example: headers = {'Access-Control-Allow-Origin': 'http://mozilla.com'}
• libcloud_kwargs (dict) -- Extra arguments for the driver's upload_object method
Returns The object name in the cloud
salt myminion libcloud_storage.upload_object /file/to/me.jpg MyFolder me.jpg profile1
salt.modules.linux_acl Support for Linux File Access Control Lists
The Linux ACL module requires the getfacl and setfacl binaries.
salt.modules.linux_acl.delfacl(acl_type, acl_name='', *args, **kwargs) Remove specific FACL from the specified file(s)
salt '*' acl.delfacl user myuser /tmp/house/kitchen salt '*' acl.delfacl default:group mygroup /tmp/house/kitchen salt '*' acl.delfacl d:u myuser /tmp/house/kitchen salt '*' acl.delfacl g myuser /tmp/house/kitchen /tmp/house/livingroom salt '*' acl.delfacl user myuser /tmp/house/kitchen recursive=True
salt.modules.linux_acl.getfacl(*args, **kwargs) Return (extremely verbose) map of FACLs on specified file(s)
salt '*' acl.getfacl /tmp/house/kitchen salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom recursive=True
salt.modules.linux_acl.modfacl(acl_type, acl_name='', perms='', *args, **kwargs) Add or modify a FACL for the specified file(s)
salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen salt '*' acl.modfacl default:group mygroup rx /tmp/house/kitchen salt '*' acl.modfacl d:u myuser 7 /tmp/house/kitchen salt '*' acl.modfacl g mygroup 0 /tmp/house/kitchen /tmp/house/livingroom salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen recursive=True salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen raise_err=True
salt.modules.linux_acl.version() Return facl version from getfacl --version
salt '*' acl.version
salt.modules.linux_acl.wipefacls(*args, **kwargs) Remove all FACLs from the specified file(s)
salt '*' acl.wipefacls /tmp/house/kitchen salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/livingroom salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/livingroom recursive=True
salt.modules.linux_ip The networking module for Non-RH/Deb Linux distros
salt.modules.linux_ip.down(iface, iface_type=None) Shutdown a network interface
salt '*' ip.down eth0
salt.modules.linux_ip.get_interface(iface) Return the contents of an interface script
salt.modules.linux_ip.get_routes(iface=None) Return the current routing table
salt '*' ip.get_routes salt '*' ip.get_routes eth0
salt.modules.linux_ip.up(iface, iface_type=None) Start up a network interface
salt '*' ip.up eth0
salt.modules.linux_lvm Support for Linux LVM2
salt.modules.linux_lvm.fullversion() Return all version info from lvm version
salt '*' lvm.fullversion
salt.modules.linux_lvm.lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=None, thinvolume=False, thinpool=False, force=False, **kwargs) Create a new logical volume, with option for which physical volume to be used
salt '*' lvm.lvcreate new_volume_name     vg_name size=10G salt '*' lvm.lvcreate new_volume_name     vg_name extents=100 pv=/dev/sdb salt '*' lvm.lvcreate new_snapshot        vg_name snapshot=volume_name size=3G
New in version 0.12.0.
Support for thin pools and thin volumes
salt '*' lvm.lvcreate new_thinpool_name   vg_name               size=20G thinpool=True salt '*' lvm.lvcreate new_thinvolume_name vg_name/thinpool_name size=10G thinvolume=True
salt.modules.linux_lvm.lvdisplay(lvname='', quiet=False) Return information about the logical volume(s)
lvname logical device name
quiet  if the logical volume is not present, do not show any error
salt '*' lvm.lvdisplay salt '*' lvm.lvdisplay /dev/vg_myserver/root
salt.modules.linux_lvm.lvextend(size=None, lvpath=None, extents=None, force=False, resizefs=False) Increase a logical volume to specific size.
salt '*' lvm.lvextend +12M /dev/mapper/vg1-test salt '*' lvm.lvextend lvpath=/dev/mapper/vg1-test extents=+100%FREE
salt.modules.linux_lvm.lvremove(lvname, vgname, force=True) Remove a given existing logical volume from a named existing volume group
salt '*' lvm.lvremove lvname vgname force=True
salt.modules.linux_lvm.lvresize(size=None, lvpath=None, extents=None, force=False, resizefs=False) Resize a logical volume to specific size.
salt '*' lvm.lvresize +12M /dev/mapper/vg1-test salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE
salt.modules.linux_lvm.pvcreate(devices, override=True, force=True, **kwargs) Set a physical device to be used as an LVM physical volume
override Skip devices, if they are already LVM physical volumes
salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine lvm.pvcreate /dev/sdb1 dataalignmentoffset=7s
salt.modules.linux_lvm.pvdisplay(pvname='', real=False, quiet=False) Return information about the physical volume(s)
pvname physical device name
real   dereference any symlinks and report the real device
New in version 2015.8.7.
quiet  if the physical volume is not present, do not show any error
salt '*' lvm.pvdisplay salt '*' lvm.pvdisplay /dev/md0
salt.modules.linux_lvm.pvremove(devices, override=True, force=True) Remove a physical device being used as an LVM physical volume
override Skip devices, if they are already not used as LVM physical volumes
salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2
salt.modules.linux_lvm.pvresize(devices, override=True, force=True) Resize a LVM physical volume to the physical device size
salt mymachine lvm.pvresize /dev/sdb1,/dev/sdb2
salt.modules.linux_lvm.version() Return LVM version from lvm version
salt '*' lvm.version
salt.modules.linux_lvm.vgcreate(vgname, devices, force=False, **kwargs) Create an LVM volume group
salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y
salt.modules.linux_lvm.vgdisplay(vgname='', quiet=False) Return information about the volume group(s)
vgname volume group name
quiet  if the volume group is not present, do not show any error
salt '*' lvm.vgdisplay salt '*' lvm.vgdisplay nova-volumes
salt.modules.linux_lvm.vgextend(vgname, devices, force=False) Add physical volumes to an LVM volume group
salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1
salt.modules.linux_lvm.vgremove(vgname, force=True) Remove an LVM volume group
salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True
salt.modules.linux_service If Salt's OS detection does not identify a different virtual service module, the minion will fall back to using this basic module, which simply wraps sysvinit scripts.
salt.modules.linux_service.available(name) Returns True if the specified service is available, otherwise returns False.
salt.modules.linux_service.get_all() Return a list of all available services
salt.modules.linux_service.missing(name) The inverse of service.available.  Returns True if the specified service is not available, otherwise returns False.
salt.modules.linux_service.reload_(name) Refreshes config files by calling service reload. Does not perform a full restart.
salt.modules.linux_service.restart(name) Restart the specified service
salt.modules.linux_service.run(name, action) Run the specified service with an action.
name   Service name.
action Action name (like start,  stop,  reload,  restart).
salt '*' service.run apache2 reload salt '*' service.run postgresql initdb
salt.modules.linux_service.start(name) Start the specified service
salt.modules.linux_service.status(name, sig=None) Return the status for a service.  If the name contains globbing, a dict mapping service name to PID or empty string is returned.
Returns PID if running, empty otherwise dict: Maps service name to PID if running, empty string otherwise
salt.modules.linux_service.stop(name) Stop the specified service
salt.modules.linux_shadow Manage the shadow file on Linux systems
salt.modules.linux_shadow.default_hash() Returns the default hash used for unset passwords
salt.modules.linux_shadow.del_password(name, root=None) New in version 2014.7.0.
name   User to delete
salt.modules.linux_shadow.gen_password(password, crypt_salt=None, algorithm='sha512') New in version 2014.7.0.
Generate hashed password
salt.modules.linux_shadow.info(name, root=None) Return information for the specified user
name   User to get the information for
salt '*' shadow.info root
salt.modules.linux_shadow.list_users(root=None) New in version 2018.3.0.
Return a list of all shadow users
salt '*' shadow.list_users
salt.modules.linux_shadow.lock_password(name, root=None) New in version 2016.11.0.
Lock the password from specified user
name   User to lock
salt '*' shadow.lock_password username
salt.modules.linux_shadow.set_date(name, date, root=None) Sets the value for the date the password was last changed to days since the epoch (January 1, 1970). See man chage.
name   User to modify
date   Date the password was last changed
salt '*' shadow.set_date username 0
salt.modules.linux_shadow.set_expire(name, expire, root=None) Changed in version 2014.7.0.
Sets the value for the date the account expires as days since the epoch (January 1, 1970). Using a value of -1 will clear expiration. See man chage.
date   Date the account expires
salt '*' shadow.set_expire username -1
salt.modules.linux_shadow.set_inactdays(name, inactdays, root=None) Set the number of days of inactivity after a password has expired before the account is locked. See man chage.
inactdays Set password inactive after this number of days
salt '*' shadow.set_inactdays username 7
salt.modules.linux_shadow.set_maxdays(name, maxdays, root=None) Set the maximum number of days during which a password is valid. See man chage.
maxdays Maximum number of days during which a password is valid
salt '*' shadow.set_maxdays username 90
salt.modules.linux_shadow.set_mindays(name, mindays, root=None) Set the minimum number of days between password changes. See man chage.
mindays Minimum number of days between password changes
salt '*' shadow.set_mindays username 7
salt.modules.linux_shadow.set_password(name, password, use_usermod=False, root=None) Set the password for a named user. The password must be a properly defined hash. The password hash can be generated with this command:
python -c "import crypt; print crypt.crypt('password', '\$6\$SALTsalt')"
SALTsalt is the 8-character crpytographic salt. Valid characters in the salt are ., /, and any alphanumeric character.
Keep in mind that the $6 represents a sha512 hash, if your OS is using a different hashing algorithm this needs to be changed accordingly
name   User to set the password
password Password already hashed
use_usermod Use usermod command to better compatibility
salt '*' shadow.set_password root '$1$UYCIxa628.9qXjpQCjM4a..'
salt.modules.linux_shadow.set_warndays(name, warndays, root=None) Set the number of days of warning before a password change is required.  See man chage.
warndays Number of days of warning before a password change is required
salt '*' shadow.set_warndays username 7
salt.modules.linux_shadow.unlock_password(name, root=None) New in version 2016.11.0.
Unlock the password from name user
name   User to unlock
salt '*' shadow.unlock_password username
salt.modules.linux_sysctl Module for viewing and modifying sysctl parameters
salt.modules.linux_sysctl.assign(name, value) Assign a single sysctl parameter for this minion
salt '*' sysctl.assign net.ipv4.ip_forward 1
salt.modules.linux_sysctl.default_config() Linux hosts using systemd 207 or later ignore /etc/sysctl.conf and only load from /etc/sysctl.d/*.conf. This function will do the proper checks and return a default config file which will be valid for the Minion. Hosts running systemd >= 207 will use /etc/sysctl.d/99-salt.conf.
salt -G 'kernel:Linux' sysctl.default_config
salt.modules.linux_sysctl.get(name) Return a single sysctl parameter for this minion
salt '*' sysctl.get net.ipv4.ip_forward
salt.modules.linux_sysctl.persist(name, value, config=None) Assign and persist a simple sysctl parameter for this minion. If config is not specified, a sensible default will be chosen using sysctl.default_config.
salt '*' sysctl.persist net.ipv4.ip_forward 1
salt.modules.linux_sysctl.show(config_file=False) Return a list of sysctl parameters for this minion
salt.modules.localemod Module for managing locales on POSIX-like systems.
salt.modules.localemod.avail(locale) Check if a locale is available.
salt '*' locale.avail 'en_US.UTF-8'
salt.modules.localemod.gen_locale(locale, **kwargs) Generate a locale. Options:
Parameters locale -- Any locale listed in /usr/share/i18n/locales or /usr/share/i18n/SUPPORTED for Debian and Gentoo based distributions, which require the charmap to be specified as part of the locale when generating it.
verbose Show extra warnings about errors that are normally ignored.
salt '*' locale.gen_locale en_US.UTF-8 salt '*' locale.gen_locale 'en_IE.UTF-8 UTF-8'    # Debian/Gentoo only
salt.modules.localemod.get_locale() Get the current system locale
salt '*' locale.get_locale
salt.modules.localemod.list_avail() Lists available (compiled) locales
salt '*' locale.list_avail
salt.modules.localemod.set_locale(locale) Sets the current system locale
salt '*' locale.set_locale 'en_US.UTF-8'
salt.modules.locate Module for using the locate utilities
salt.modules.locate.locate(pattern, database='', limit=0, **kwargs) Performs a file lookup. Valid options (and their defaults) are:
basename=False count=False existing=False follow=True ignore=False nofollow=False wholename=True regex=False database=<locate's default database> limit=<integer, not set by default>
See the manpage for locate(1) for further explanation of these options.
salt '*' locate.locate
salt.modules.locate.stats() Returns statistics about the locate database
salt '*' locate.stats
salt.modules.locate.updatedb() Updates the locate database
salt '*' locate.updatedb
salt.modules.locate.version() Returns the version of locate
salt '*' locate.version
salt.modules.logadm Module for managing Solaris logadm based log rotations.
salt.modules.logadm.list_conf(conf_file='/etc/logadm.conf', log_file=None, include_unset=False) Show parsed configuration
conf_file string path to logadm.conf, defaults to /etc/logadm.conf
log_file string optional show only one log file
include_unset boolean include unset flags in output
salt '*' logadm.list_conf salt '*' logadm.list_conf log=/var/log/syslog salt '*' logadm.list_conf include_unset=False
salt.modules.logadm.remove(name, conf_file='/etc/logadm.conf') Remove log pattern from logadm
salt '*' logadm.remove myapplog
salt.modules.logadm.rotate(name, pattern=None, conf_file='/etc/logadm.conf', **kwargs) Set up pattern for logging.
name   string alias for entryname
pattern string alias for log_file
conf_file string optional path to alternative configuration file
kwargs boolean|string|int optional additional flags and parameters
NOTE: name and pattern were kept for backwards compatibility reasons.
name is an alias for the entryname argument, pattern is an alias for log_file. These aliases will only be used if the entryname and log_file arguments are not passed.
For a full list of arguments see `logadm.show_args`.
salt '*' logadm.rotate myapplog pattern='/var/log/myapp/*.log' count=7 salt '*' logadm.rotate myapplog log_file='/var/log/myapp/*.log' count=4 owner=myappd mode='0700'
salt.modules.logadm.show_args() Show which arguments map to which flags and options.
salt '*' logadm.show_args
salt.modules.logadm.show_conf(conf_file='/etc/logadm.conf', name=None) Show configuration
name   string optional show only a single entry
salt '*' logadm.show_conf salt '*' logadm.show_conf name=/var/log/syslog
salt.modules.logmod On-demand logging New in version 2017.7.0.
The sole purpose of this module is logging messages in the (proxy) minion.  It comes very handy when debugging complex Jinja templates, for example:
{%- for var in range(10) %} {%- do salt.log.info(var) -%} {%- endfor %}
salt '*' log.error "Please don't do that, this module is not for CLI use!"
salt.modules.logmod.critical(message) Log message at level CRITICAL.
salt.modules.logmod.debug(message) Log message at level DEBUG.
salt.modules.logmod.error(message) Log message at level ERROR.
salt.modules.logmod.exception(message) Log message at level EXCEPTION.
salt.modules.logmod.info(message) Log message at level INFO.
salt.modules.logmod.warning(message) Log message at level WARNING.
salt.modules.logrotate Module for managing logrotate.
salt.modules.logrotate.get(key, value=None, conf_file='/etc/logrotate.conf') Get the value for a specific configuration line.
• key (str) -- The command or stanza block to configure.
• value (str) -- The command value or command of the block specified by the key parameter.
• conf_file (str) -- The logrotate configuration file.
Returns The value for a specific configuration line.
Return type bool|int|str
salt '*' logrotate.get rotate
salt '*' logrotate.get /var/log/wtmp rotate /etc/logrotate.conf
salt.modules.logrotate.set_(key, value, setting=None, conf_file='/etc/logrotate.conf') Set a new value for a specific configuration line.
• key (str) -- The command or block to configure.
• setting (str) -- The command value for the command specified by the value parameter.
salt '*' logrotate.set rotate 2
Can also be used to set a single value inside a multiline configuration block. For instance, to change rotate in the following block:
/var/log/wtmp { monthly create 0664 root root rotate 1 }
Use the following command:
salt '*' logrotate.set /var/log/wtmp rotate 2
This module also has the ability to scan files inside an include directory, and make changes in the appropriate file.
salt.modules.logrotate.show_conf(conf_file='/etc/logrotate.conf') Show parsed configuration
Parameters conf_file (str) -- The logrotate configuration file.
Returns The parsed configuration.
salt '*' logrotate.show_conf
salt.modules.lvs Support for LVS (Linux Virtual Server)
salt.modules.lvs.add_server(protocol=None, service_address=None, server_address=None, packet_forward_method='dr', weight=1, **kwargs) Add a real server to a virtual service.
protocol The service protocol(only support tcp, udp and fwmark service).
service_address The LVS service address.
server_address The real server address.
packet_forward_method The LVS packet forwarding method(dr for direct routing, tunnel for tunneling, nat for network access translation).
weight The capacity  of a server relative to the others in the pool.
salt '*' lvs.add_server tcp 1.1.1.1:80 192.168.0.11:8080 nat 1
salt.modules.lvs.add_service(protocol=None, service_address=None, scheduler='wlc') Add a virtual service.
scheduler Algorithm for allocating TCP connections and UDP datagrams to real servers.
salt '*' lvs.add_service tcp 1.1.1.1:80 rr
salt.modules.lvs.check_server(protocol=None, service_address=None, server_address=None, **kwargs) Check the real server exists in the specified service.
salt '*' lvs.check_server tcp 1.1.1.1:80 192.168.0.11:8080
salt.modules.lvs.check_service(protocol=None, service_address=None, **kwargs) Check the virtual service exists.
salt '*' lvs.check_service tcp 1.1.1.1:80
salt.modules.lvs.clear() Clear the virtual server table
salt '*' lvs.clear
salt.modules.lvs.delete_server(protocol=None, service_address=None, server_address=None) Delete the realserver from the virtual service.
salt '*' lvs.delete_server tcp 1.1.1.1:80 192.168.0.11:8080
salt.modules.lvs.delete_service(protocol=None, service_address=None) Delete the virtual service.
salt '*' lvs.delete_service tcp 1.1.1.1:80
salt.modules.lvs.edit_server(protocol=None, service_address=None, server_address=None, packet_forward_method=None, weight=None, **kwargs) Edit a real server to a virtual service.
salt '*' lvs.edit_server tcp 1.1.1.1:80 192.168.0.11:8080 nat 1
salt.modules.lvs.edit_service(protocol=None, service_address=None, scheduler=None) Edit the virtual service.
salt '*' lvs.edit_service tcp 1.1.1.1:80 rr
salt.modules.lvs.get_rules() Get the virtual server rules
salt '*' lvs.get_rules
salt.modules.lvs.list_(protocol=None, service_address=None) List the virtual server table if service_address is not specified. If a service_address is selected, list this service only.
salt '*' lvs.list
salt.modules.lvs.zero(protocol=None, service_address=None) Zero the packet, byte and rate counters in a service or all services.
salt '*' lvs.zero
salt.modules.lxc Control Linux Containers via Salt
depends lxc package for distribution
lxc >= 1.0 (even beta alpha) is required
salt.modules.lxc.add_veth(name, interface_name, bridge=None, path=None) Add a veth to a container.  Note : this function doesn't update the container config, just add the interface at runtime
name   Name of the container
interface_name Name of the interface in the container
bridge Name of the bridge to attach the interface to (facultative)
salt '*' lxc.add_veth container_name eth1 br1 salt '*' lxc.add_veth container_name eth1
salt.modules.lxc.apply_network_profile(name, network_profile, nic_opts=None, path=None) New in version 2015.5.0.
Apply a network profile to a container
network_profile profile name or default values (dict)
nic_opts values to override in defaults (dict) indexed by nic card names
path   path to the container parent
salt 'minion' lxc.apply_network_profile web1 centos salt 'minion' lxc.apply_network_profile web1 centos \ nic_opts="{'eth0': {'mac': 'xx:xx:xx:xx:xx:xx'}}" salt 'minion' lxc.apply_network_profile web1 \ "{'eth0': {'mac': 'xx:xx:xx:xx:xx:yy'}}" nic_opts="{'eth0': {'mac': 'xx:xx:xx:xx:xx:xx'}}"
The special case to disable use of ethernet nics:
salt 'minion' lxc.apply_network_profile web1 centos \ "{eth0: {disable: true}}"
salt.modules.lxc.attachable(name, path=None) Return True if the named container can be attached to via the lxc-attach command
path   path to the container parent default: /var/lib/lxc (system default)
salt 'minion' lxc.attachable ubuntu
salt.modules.lxc.bootstrap(name, config=None, approve_key=True, install=True, pub_key=None, priv_key=None, bootstrap_url=None, force_install=False, unconditional_install=False, path=None, bootstrap_delay=None, bootstrap_args=None, bootstrap_shell=None) Install and configure salt in a container.
config Minion configuration options. By default, the master option is set to the target host's master.
approve_key Request a pre-approval of the generated minion key. Requires that the salt-master be configured to either auto-accept all keys or expect a signing request from the target host. Default: True
pub_key Explicit public key to pressed the minion with (optional). This can be either a filepath or a string representing the key
priv_key Explicit private key to pressed the minion with (optional). This can be either a filepath or a string representing the key
bootstrap_delay Delay in seconds between end of container creation and bootstrapping.  Useful when waiting for container to obtain a DHCP lease.
bootstrap_url url, content or filepath to the salt bootstrap script
bootstrap_args salt bootstrap script arguments
bootstrap_shell shell to execute the script into
install Whether to attempt a full installation of salt-minion if needed.
force_install Force installation even if salt-minion is detected, this is the way to run vendor bootstrap scripts even if a salt minion is already present in the container
unconditional_install Run the script even if the container seems seeded
salt 'minion' lxc.bootstrap container_name [config=config_data] \ [approve_key=(True|False)] [install=(True|False)]
salt.modules.lxc.clone(name, orig, profile=None, network_profile=None, nic_opts=None, **kwargs) Create a new container as a clone of another container
orig   Name of the original container to be cloned
profile Profile to use in container cloning (see lxc.get_container_profile). Values in a profile will be overridden by the Container Cloning Arguments listed below.
path   path to the container parent directory default: /var/lib/lxc (system)
Container Cloning Arguments
snapshot Use Copy On Write snapshots (LVM)
size   1G Size of the volume to create. Only applicable if backing=lvm.
backing The type of storage to use. Set to lvm to use an LVM group. Defaults to filesystem within /var/lib/lxc.
network_profile Network profile to use for container
nic_opts give extra opts overriding network profile values
salt '*' lxc.clone myclone orig=orig_container salt '*' lxc.clone myclone orig=orig_container snapshot=True
salt.modules.lxc.cloud_init(name, vm_=None, **kwargs) Thin wrapper to lxc.init to be used from the saltcloud lxc driver
name   Name of the container may be None and then guessed from saltcloud mapping
vm_    saltcloud mapping defaults for the vm
salt '*' lxc.cloud_init foo
salt.modules.lxc.cloud_init_interface(name, vm_=None, **kwargs) Interface between salt.cloud.lxc driver and lxc.init vm_ is a mapping of vm opts in the salt.cloud format as documented for the lxc driver.
This can be used either:
• from the salt cloud driver
• because you find the argument to give easier here than using directly lxc.init
WARNING: BE REALLY CAREFUL CHANGING DEFAULTS !!!  IT'S A RETRO COMPATIBLE INTERFACE WITH THE SALT CLOUD DRIVER (ask kiorky).
name   name of the lxc container to create
pub_key public key to preseed the minion with.  Can be the keycontent or a filepath
priv_key private key to preseed the minion with.  Can be the keycontent or a filepath
path   path to the container parent directory (default: /var/lib/lxc)
profile profile selection
network_profile network profile selection
nic_opts per interface settings compatibles with network profile (ipv4/ipv6/link/gateway/mac/netmask)
eg:
- {'eth0': {'mac': '00:16:3e:01:29:40', 'gateway': None, (default) 'link': 'br0', (default) 'gateway': None, (default) 'netmask': '', (default) 'ip': '22.1.4.25'}}
unconditional_install given to lxc.bootstrap (see relative doc)
force_install given to lxc.bootstrap (see relative doc)
config any extra argument for the salt minion config
dnsservers list of DNS servers to set inside the container
dns_via_dhcp do not set the dns servers, let them be set by the dhcp.
autostart autostart the container at boot time
password administrative password for the container
bootstrap_delay delay before launching bootstrap script at Container init
WARNING: Legacy but still supported options:
from_container which container we use as a template when running lxc.clone
image  which template do we use when we are using lxc.create. This is the default mode unless you specify something in from_container
backing which backing store to use.  Values can be: overlayfs, dir(default), lvm, zfs, brtfs
fstype When using a blockdevice level backing store, which filesystem to use on
size   When using a blockdevice level backing store, which size for the filesystem to use on
snapshot Use snapshot when cloning the container source
vgname if using LVM: vgname
lvname if using LVM: lvname
thinpool: if using LVM: thinpool
ip     ip for the primary nic
mac    mac address for the primary nic
netmask netmask for the primary nic (24) = vm_.get('netmask', '24')
bridge bridge for the primary nic (lxcbr0)
gateway network gateway for the container
additional_ips additional ips which will be wired on the main bridge (br0) which is connected to internet.  Be aware that you may use manual virtual mac addresses providen by you provider (online, ovh, etc).  This is a list of mappings {ip: '', mac: '', netmask:''} Set gateway to None and an interface with a gateway to escape from another interface that eth0.  eg:
- {'mac': '00:16:3e:01:29:40', 'gateway': None, (default) 'link': 'br0', (default) 'netmask': '', (default) 'ip': '22.1.4.25'}
users  administrative users for the container default: [root] and [root, ubuntu] on ubuntu
default_nic name of the first interface, you should really not override this
salt '*' lxc.cloud_init_interface foo
salt.modules.lxc.copy_to(name, source, dest, overwrite=False, makedirs=False, path=None) Changed in version 2015.8.0: Function renamed from lxc.cp to lxc.copy_to for consistency with other container types. lxc.cp will continue to work, however.  For versions 2015.2.x and earlier, use lxc.cp.
Copy a file or directory from the host into a container
source File to be copied to the container