text stringlengths 81 112k |
|---|
.. versionadded:: 2019.2.0
Ensure a security rule does not exist in the network security group.
:param name:
Name of the security rule.
:param security_group:
The network security group containing the security rule.
:param resource_group:
The resource group assigned to the ne... |
.. versionadded:: 2019.2.0
Ensure a load balancer exists.
:param name:
Name of the load balancer.
:param resource_group:
The resource group assigned to the load balancer.
:param sku:
The load balancer SKU, which can be 'Basic' or 'Standard'.
:param tags:
A dictio... |
.. versionadded:: 2019.2.0
Ensure a load balancer does not exist in the resource group.
:param name:
Name of the load balancer.
:param resource_group:
The resource group assigned to the load balancer.
:param connection_auth:
A dict with subscription and authentication paramet... |
.. versionadded:: 2019.2.0
Ensure a public IP address exists.
:param name:
Name of the public IP address.
:param resource_group:
The resource group assigned to the public IP address.
:param dns_settings:
An optional dictionary representing a valid PublicIPAddressDnsSettings o... |
.. versionadded:: 2019.2.0
Ensure a public IP address does not exist in the resource group.
:param name:
Name of the public IP address.
:param resource_group:
The resource group assigned to the public IP address.
:param connection_auth:
A dict with subscription and authentica... |
.. versionadded:: 2019.2.0
Ensure a network interface exists.
:param name:
Name of the network interface.
:param ip_configurations:
A list of dictionaries representing valid NetworkInterfaceIPConfiguration objects. The 'name' key is required at
minimum. At least one IP Configurati... |
.. versionadded:: 2019.2.0
Ensure a network interface does not exist in the resource group.
:param name:
Name of the network interface.
:param resource_group:
The resource group assigned to the network interface.
:param connection_auth:
A dict with subscription and authentica... |
.. versionadded:: 2019.2.0
Ensure a route table exists.
:param name:
Name of the route table.
:param resource_group:
The resource group assigned to the route table.
:param routes:
An optional list of dictionaries representing valid Route objects contained within a route table... |
.. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param resource_group:
The resource group assigned to the route table.
:param connection_auth:
A dict with subscription and authentication parameters to... |
.. versionadded:: 2019.2.0
Ensure a route exists within a route table.
:param name:
Name of the route.
:param address_prefix:
The destination CIDR to which the route applies.
:param next_hop_type:
The type of Azure hop the packet should be sent to. Possible values are: 'Virtu... |
.. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param route_table:
The name of the existing route table containing the route.
:param resource_group:
The resource group assigned to the route table.
... |
Generate a jid
def gen_jid(opts=None):
'''
Generate a jid
'''
if opts is None:
salt.utils.versions.warn_until(
'Sodium',
'The `opts` argument was not passed into salt.utils.jid.gen_jid(). '
'This will be required starting in {version}.'
)
opts... |
Returns True if the passed in value is a job id
def is_jid(jid):
'''
Returns True if the passed in value is a job id
'''
if not isinstance(jid, six.string_types):
return False
if len(jid) != 20 and (len(jid) <= 21 or jid[20] != '_'):
return False
try:
int(jid[:20])
... |
Convert a salt job id into the time when the job was invoked
def jid_to_time(jid):
'''
Convert a salt job id into the time when the job was invoked
'''
jid = six.text_type(jid)
if len(jid) != 20 and (len(jid) <= 21 or jid[20] != '_'):
return ''
year = jid[:4]
month = jid[4:6]
da... |
Format the job instance correctly
def format_job_instance(job):
'''
Format the job instance correctly
'''
ret = {'Function': job.get('fun', 'unknown-function'),
'Arguments': list(job.get('arg', [])),
# unlikely but safeguard from invalid returns
'Target': job.get('tgt',... |
Format the jid correctly
def format_jid_instance(jid, job):
'''
Format the jid correctly
'''
ret = format_job_instance(job)
ret.update({'StartTime': jid_to_time(jid)})
return ret |
Format the jid correctly with jid included
def format_jid_instance_ext(jid, job):
'''
Format the jid correctly with jid included
'''
ret = format_job_instance(job)
ret.update({
'JID': jid,
'StartTime': jid_to_time(jid)})
return ret |
Return the jid_dir for the given job id
def jid_dir(jid, job_dir=None, hash_type='sha256'):
'''
Return the jid_dir for the given job id
'''
if not isinstance(jid, six.string_types):
jid = six.text_type(jid)
jhash = getattr(hashlib, hash_type)(
salt.utils.stringutils.to_bytes(jid)).h... |
Change the system runlevel on sysV compatible systems
CLI Example:
.. code-block:: bash
salt '*' system.init 3
def init(runlevel):
'''
Change the system runlevel on sysV compatible systems
CLI Example:
.. code-block:: bash
salt '*' system.init 3
'''
cmd = ['init', ... |
Reboot the system
at_time
The wait time in minutes before the system will be rebooted.
CLI Example:
.. code-block:: bash
salt '*' system.reboot
def reboot(at_time=None):
'''
Reboot the system
at_time
The wait time in minutes before the system will be rebooted.
... |
Shutdown a running system
at_time
The wait time in minutes before the system will be shutdown.
CLI Example:
.. code-block:: bash
salt '*' system.shutdown 5
def shutdown(at_time=None):
'''
Shutdown a running system
at_time
The wait time in minutes before the system w... |
set the system date/time using the date command
Note using a strictly posix-compliant date binary we can only set the date
up to the minute.
def _date_bin_set_datetime(new_date):
'''
set the system date/time using the date command
Note using a strictly posix-compliant date binary we can only set ... |
Returns True if the system has a hardware clock capable of being
set from software.
CLI Example:
salt '*' system.has_settable_hwclock
def has_settable_hwclock():
'''
Returns True if the system has a hardware clock capable of being
set from software.
CLI Example:
salt '*' system.has_... |
Set hardware clock to value of software clock.
def _swclock_to_hwclock():
'''
Set hardware clock to value of software clock.
'''
res = __salt__['cmd.run_all'](['hwclock', '--systohc'], python_shell=False)
if res['retcode'] != 0:
msg = 'hwclock failed to set hardware clock from software cloc... |
Helper function that converts the utc offset string into number of minutes
offset. Input is in form "[+-]?HHMM". Example valid inputs are "+0500"
"-0300" and "0800". These would return -300, 180, 480 respectively.
def _offset_to_min(utc_offset):
'''
Helper function that converts the utc offset string i... |
Will return the current time adjusted using the input timezone offset.
:rtype datetime:
def _get_offset_time(utc_offset):
'''
Will return the current time adjusted using the input timezone offset.
:rtype datetime:
'''
if utc_offset is not None:
minutes = _offset_to_min(utc_offset)
... |
Set the system time.
:param str newtime:
The time to set. Can be any of the following formats.
- HH:MM:SS AM/PM
- HH:MM AM/PM
- HH:MM:SS (24 hour)
- HH:MM (24 hour)
Note that the salt command line parser parses the date/time
before we obtain the argument (pr... |
Set the system date and time. Each argument is an element of the date, but
not required. If an element is not passed, the current system value for
that element will be used. For example, if you don't pass the year, the
current system year will be used. (Used by set_system_date and
set_system_time)
... |
Get PRETTY_HOSTNAME value stored in /etc/machine-info
If this file doesn't exist or the variable doesn't exist
return False.
:return: Value of PRETTY_HOSTNAME if this does not exist False.
:rtype: str
CLI Example:
.. code-block:: bash
salt '*' system.get_computer_desc
def get_comput... |
Set PRETTY_HOSTNAME value stored in /etc/machine-info
This will create the file if it does not exist. If
it is unable to create or modify this file returns False.
:param str desc: The computer description
:return: False on failure. True if successful.
CLI Example:
.. code-block:: bash
... |
This function is used to remember that an event indicating that a reboot is
required was witnessed. This function writes to a temporary filesystem so
the event gets cleared upon reboot.
Returns:
bool: ``True`` if successful, otherwise ``False``
.. code-block:: bash
salt '*' system.set... |
Override this to handle the streams as they arrive
:param IOStream stream: An IOStream for processing
See https://tornado.readthedocs.io/en/latest/iostream.html#tornado.iostream.IOStream
for additional details.
def handle_stream(self, stream):
'''
Override this to handle the s... |
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to prevent
leaks.
def close(self):
'''
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to preve... |
Connect to the IPC socket
def connect(self, callback=None, timeout=None):
'''
Connect to the IPC socket
'''
if hasattr(self, '_connecting_future') and not self._connecting_future.done(): # pylint: disable=E0203
future = self._connecting_future # pylint: disable=E0203
... |
Connect to a running IPCServer
def _connect(self, timeout=None):
'''
Connect to a running IPCServer
'''
if isinstance(self.socket_path, int):
sock_type = socket.AF_INET
sock_addr = ('127.0.0.1', self.socket_path)
else:
sock_type = socket.AF_UN... |
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to prevent
leaks.
def close(self):
'''
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to preve... |
Send a message to an IPC socket
If the socket is not currently connected, a connection will be established.
:param dict msg: The message to be sent
:param int timeout: Timeout when sending message (Currently unimplemented)
def send(self, msg, timeout=None, tries=None):
'''
Sen... |
Perform the work necessary to start up a Tornado IPC server
Blocks until socket is established
def start(self):
'''
Perform the work necessary to start up a Tornado IPC server
Blocks until socket is established
'''
# Start up the ioloop
log.trace('IPCMessagePub... |
Send message to all connected sockets
def publish(self, msg):
'''
Send message to all connected sockets
'''
if not self.streams:
return
pack = salt.transport.frame.frame_msg_ipc(msg, raw_body=True)
for stream in self.streams:
self.io_loop.spawn_... |
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to prevent
leaks.
def close(self):
'''
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to preve... |
Read a message from an IPC socket
The socket must already be connected.
The associated IO Loop must NOT be running.
:param int timeout: Timeout when receiving message
:return: message data if successful. None if timed out. Will raise an
exception for all other error con... |
Asynchronously read messages and invoke a callback when they are ready.
:param callback: A callback with the received data
def read_async(self):
'''
Asynchronously read messages and invoke a callback when they are ready.
:param callback: A callback with the received data
'''
... |
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to prevent
leaks.
def close(self):
'''
Routines to handle any cleanup before the instance shuts down.
Sockets and filehandles should be closed explicitly, to preve... |
List the jobs currently scheduled on the minion
CLI Example:
.. code-block:: bash
salt '*' schedule.list
# Show all jobs including hidden internal jobs
salt '*' schedule.list show_all=True
# Hide disabled jobs from list of jobs
salt '*' schedule.list show_disabled=Fa... |
List a Job only if its enabled
.. versionadded:: 2015.5.3
CLI Example:
.. code-block:: bash
salt '*' schedule.is_enabled name=job_name
def is_enabled(name):
'''
List a Job only if its enabled
.. versionadded:: 2015.5.3
CLI Example:
.. code-block:: bash
salt '*' s... |
Purge all the jobs currently scheduled on the minion
CLI Example:
.. code-block:: bash
salt '*' schedule.purge
def purge(**kwargs):
'''
Purge all the jobs currently scheduled on the minion
CLI Example:
.. code-block:: bash
salt '*' schedule.purge
'''
ret = {'comme... |
Build a schedule job
CLI Example:
.. code-block:: bash
salt '*' schedule.build_schedule_item job1 function='test.ping' seconds=3600
def build_schedule_item(name, **kwargs):
'''
Build a schedule job
CLI Example:
.. code-block:: bash
salt '*' schedule.build_schedule_item job... |
Add a job to the schedule
CLI Example:
.. code-block:: bash
salt '*' schedule.add job1 function='test.ping' seconds=3600
# If function have some arguments, use job_args
salt '*' schedule.add job2 function='cmd.run' job_args="['date >> /tmp/date.log']" seconds=60
def add(name, **kwarg... |
Modify an existing job in the schedule
CLI Example:
.. code-block:: bash
salt '*' schedule.modify job1 function='test.ping' seconds=3600
def modify(name, **kwargs):
'''
Modify an existing job in the schedule
CLI Example:
.. code-block:: bash
salt '*' schedule.modify job1 f... |
Run a scheduled job on the minion immediately
CLI Example:
.. code-block:: bash
salt '*' schedule.run_job job1
salt '*' schedule.run_job job1 force=True
Force the job to run even if it is disabled.
def run_job(name, force=False):
'''
Run a scheduled job on the minion immedia... |
Enable a job in the minion's schedule
CLI Example:
.. code-block:: bash
salt '*' schedule.enable_job job1
def enable_job(name, **kwargs):
'''
Enable a job in the minion's schedule
CLI Example:
.. code-block:: bash
salt '*' schedule.enable_job job1
'''
ret = {'comm... |
Save all scheduled jobs on the minion
CLI Example:
.. code-block:: bash
salt '*' schedule.save
def save(**kwargs):
'''
Save all scheduled jobs on the minion
CLI Example:
.. code-block:: bash
salt '*' schedule.save
'''
ret = {'comment': [],
'result': Tru... |
Reload saved scheduled jobs on the minion
CLI Example:
.. code-block:: bash
salt '*' schedule.reload
def reload_():
'''
Reload saved scheduled jobs on the minion
CLI Example:
.. code-block:: bash
salt '*' schedule.reload
'''
ret = {'comment': [],
'resul... |
Move scheduled job to another minion or minions.
CLI Example:
.. code-block:: bash
salt '*' schedule.move jobname target
def move(name, target, **kwargs):
'''
Move scheduled job to another minion or minions.
CLI Example:
.. code-block:: bash
salt '*' schedule.move jobname ... |
Postpone a job in the minion's schedule
Current time and new time should be in date string format,
default value is %Y-%m-%dT%H:%M:%S.
.. versionadded:: 2018.3.0
CLI Example:
.. code-block:: bash
salt '*' schedule.postpone_job job current_time new_time
salt '*' schedule.postpon... |
Return True if this minion is a proxy minion.
Leverages the fact that is_linux() and is_windows
both return False for proxies.
TODO: Need to extend this for proxies that might run on
other Unices
def is_proxy():
'''
Return True if this minion is a proxy minion.
Leverages the fact that is_li... |
Function to return if host is SmartOS (Illumos) global zone or not
def is_smartos_globalzone():
'''
Function to return if host is SmartOS (Illumos) global zone or not
'''
if not is_smartos():
return False
else:
cmd = ['zonename']
try:
zonename = subprocess.Popen(... |
Create an image for a specific platform.
Please note that this function *MUST* be run as root, as images that are
created make files belonging to root.
platform
Which platform to use to create the image. Currently supported platforms
are rpm, deb and pacman.
root
Local path to... |
Make a partition, and make it bootable
.. versionadded:: Beryllium
def _mkpart(root, fs_format, fs_opts, mount_dir):
'''
Make a partition, and make it bootable
.. versionadded:: Beryllium
'''
__salt__['partition.mklabel'](root, 'msdos')
loop1 = __salt__['cmd.run']('losetup -f')
log.de... |
Make a filesystem using the appropriate module
.. versionadded:: Beryllium
def _mkfs(root, fs_format, fs_opts=None):
'''
Make a filesystem using the appropriate module
.. versionadded:: Beryllium
'''
if fs_opts is None:
fs_opts = {}
if fs_format in ('ext2', 'ext3', 'ext4'):
... |
If a ``pkg_cache`` directory is specified, then use it to populate the
disk image.
def _populate_cache(platform, pkg_cache, mount_dir):
'''
If a ``pkg_cache`` directory is specified, then use it to populate the
disk image.
'''
if not pkg_cache:
return
if not os.path.isdir(pkg_cache)... |
Bootstrap an image using the yum tools
root
The root of the image to install to. Will be created as a directory if
it does not exist. (e.x.: /root/arch)
pkg_confs
The location of the conf files to copy into the image, to point yum
to the right repos and configuration.
pkgs... |
Bootstrap an image using the Debian tools
root
The root of the image to install to. Will be created as a directory if
it does not exist. (e.x.: /root/wheezy)
arch
Architecture of the target image. (e.x.: amd64)
flavor
Flavor of Debian to install. (e.x.: wheezy)
repo_u... |
Bootstrap an image using the pacman tools
root
The root of the image to install to. Will be created as a directory if
it does not exist. (e.x.: /root/arch)
pkg_confs
The location of the conf files to copy into the image, to point pacman
to the right repos and configuration.
... |
Make the minimum number of nodes inside of /dev/. Based on:
https://wiki.archlinux.org/index.php/Linux_Containers
def _make_nodes(root):
'''
Make the minimum number of nodes inside of /dev/. Based on:
https://wiki.archlinux.org/index.php/Linux_Containers
'''
dirs = (
('{0}/etc'.format... |
Return which platforms are available
CLI Example:
.. code-block:: bash
salt myminion genesis.avail_platforms
def avail_platforms():
'''
Return which platforms are available
CLI Example:
.. code-block:: bash
salt myminion genesis.avail_platforms
'''
ret = {}
for... |
Pack up a directory structure, into a specific format
CLI Examples:
.. code-block:: bash
salt myminion genesis.pack centos /root/centos
salt myminion genesis.pack centos /root/centos pack_format='tar'
def pack(name, root, path=None, pack_format='tar', compress='bzip2'):
'''
Pack up a... |
Unpack an image into a directory structure
CLI Example:
.. code-block:: bash
salt myminion genesis.unpack centos /root/centos
def unpack(name, dest=None, path=None, pack_format='tar', compress='bz2'):
'''
Unpack an image into a directory structure
CLI Example:
.. code-block:: bash
... |
Pack up image in a tar format
def _tar(name, root, path=None, compress='bzip2'):
'''
Pack up image in a tar format
'''
if path is None:
path = os.path.join(salt.syspaths.BASE_FILE_ROOTS_DIR, 'img')
if not __salt__['file.directory_exists'](path):
try:
__salt__['file.mkdir... |
Resolve compression flags
def _compress(compress):
'''
Resolve compression flags
'''
if compress in ('bz2', 'bzip2', 'j'):
compression = 'j'
ext = 'bz2'
elif compress in ('gz', 'gzip', 'z'):
compression = 'z'
ext = 'gz'
elif compress in ('xz', 'a', 'J'):
... |
Recurse through a set of dependencies reported by ``ldd``, to find
associated dependencies.
Please note that this does not necessarily resolve all (non-package)
dependencies for a file; but it does help.
CLI Example:
salt myminion genesis.ldd_deps bash
salt myminion genesis.ldd_deps /... |
Convert an installation file/script to an SLS file. Currently supports
``kickstart``, ``preseed``, and ``autoyast``.
CLI Examples:
salt <minion> genesis.mksls kickstart /path/to/kickstart.cfg
salt <minion> genesis.mksls kickstart /path/to/kickstart.cfg /path/to/dest.sls
.. versionadded:: ... |
Execute the desired powershell command and ensure that it returns data
in json format and load that into python
def _pshell(cmd, cwd=None, json_depth=2):
'''
Execute the desired powershell command and ensure that it returns data
in json format and load that into python
'''
if 'convertto-json' n... |
List available modules in registered Powershell module repositories.
:param desc: If ``True``, the verbose description will be returned.
:type desc: ``bool``
CLI Example:
.. code-block:: bash
salt 'win01' psget.avail_modules
salt 'win01' psget.avail_modules desc=True
def avail_modu... |
List currently installed PSGet Modules on the system.
:param desc: If ``True``, the verbose description will be returned.
:type desc: ``bool``
CLI Example:
.. code-block:: bash
salt 'win01' psget.list_modules
salt 'win01' psget.list_modules desc=True
def list_modules(desc=False):
... |
Install a Powershell module from powershell gallery on the system.
:param name: Name of a Powershell module
:type name: ``str``
:param minimum_version: The maximum version to install, e.g. 1.23.2
:type minimum_version: ``str``
:param required_version: Install a specific version
:type requi... |
Update a PowerShell module to a specific version, or the newest
:param name: Name of a Powershell module
:type name: ``str``
:param maximum_version: The maximum version to install, e.g. 1.23.2
:type maximum_version: ``str``
:param required_version: Install a specific version
:type required... |
Remove a Powershell DSC module from the system.
:param name: Name of a Powershell DSC module
:type name: ``str``
CLI Example:
.. code-block:: bash
salt 'win01' psget.remove PowerPlan
def remove(name):
'''
Remove a Powershell DSC module from the system.
:param name: Name of ... |
Register a PSGet repository on the local machine
:param name: The name for the repository
:type name: ``str``
:param location: The URI for the repository
:type location: ``str``
:param installation_policy: The installation policy
for packages, e.g. Trusted, Untrusted
:type installa... |
Get the details of a local PSGet repository
:param name: Name of the repository
:type name: ``str``
CLI Example:
.. code-block:: bash
salt 'win01' psget.get_repository MyRepo
def get_repository(name):
'''
Get the details of a local PSGet repository
:param name: Name of the ... |
.. versionchanged:: 2015.8.0
The :mod:`lxc.created <salt.states.lxc.created>` state has been renamed
to ``lxc.present``, and the :mod:`lxc.cloned <salt.states.lxc.cloned>`
state has been merged into this state.
Create the named container if it does not exist
name
The name of t... |
Ensure a container is not present, destroying it if present
name
Name of the container to destroy
stop
stop before destroying
default: false
.. versionadded:: 2015.5.2
path
path to the container parent
default: /var/lib/lxc (system default)
.. ver... |
.. versionchanged:: 2015.5.0
The :mod:`lxc.started <salt.states.lxc.started>` state has been renamed
to ``lxc.running``
Ensure that a container is running
.. note::
This state does not enforce the existence of the named container, it
just starts the container if it is not runn... |
Ensure that a container is stopped
.. note::
This state does not enforce the existence of the named container, it
just stops the container if it running or frozen. To ensure that the
named container exists, use :mod:`lxc.present
<salt.states.lxc.present>`, or use the :mod:`lxc.abse... |
.. warning::
This state is unsuitable for setting parameters that appear more than
once in an LXC config file, or parameters which must appear in a
certain order (such as when configuring more than one network
interface).
`Issue #35523`_ was opened to track the addition of a su... |
Generate the salt-thin tarball and print the location of the tarball
Optional additional mods to include (e.g. mako) can be supplied as a comma
delimited string. Permits forcing an overwrite of the output file as well.
CLI Example:
.. code-block:: bash
salt-run thin.generate
salt-run... |
Generate the salt-thin tarball and print the location of the tarball
Optional additional mods to include (e.g. mako) can be supplied as a comma
delimited string. Permits forcing an overwrite of the output file as well.
CLI Example:
.. code-block:: bash
salt-run thin.generate_min
def generat... |
REST authentication
def auth(username, password):
'''
REST authentication
'''
url = rest_auth_setup()
data = {'username': username, 'password': password}
# Post to the API endpoint. If 200 is returned then the result will be the ACLs
# for this user
result = salt.utils.http.query(url... |
Ensure a user is present
.. code-block:: yaml
ensure user test is present in github:
github.present:
- name: 'gitexample'
The following parameters are required:
name
This is the github handle of the user in the organization
def present(name, profile="github",... |
Ensure a github user is absent
.. code-block:: yaml
ensure user test is absent in github:
github.absent:
- name: 'Example TestUser1'
- email: example@domain.com
- username: 'gitexample'
The following parameters are required:
name
... |
Ensure a team is present
name
This is the name of the team in the organization.
description
The description of the team.
repo_names
The names of repositories to add the team to.
privacy
The level of privacy for the team, can be 'secret' or 'closed'. Defaults
t... |
Ensure a team is absent.
Example:
.. code-block:: yaml
ensure team test is present in github:
github.team_absent:
- name: 'test'
The following parameters are required:
name
This is the name of the team in the organization.
.. versionadded:: 2016.11.... |
Ensure a repository is present
name
This is the name of the repository.
description
The description of the repository.
homepage
The URL with more information about the repository.
private
The visiblity of the repository. Note that private repositories require
... |
Return the targets from the directory of flat yaml files,
checks opts for location.
def targets(tgt, tgt_type='glob', **kwargs):
'''
Return the targets from the directory of flat yaml files,
checks opts for location.
'''
roster_dir = __opts__.get('roster_dir', '/etc/salt/roster.d')
# Match ... |
Render the roster file
def _render(roster_file, **kwargs):
"""
Render the roster file
"""
renderers = salt.loader.render(__opts__, {})
domain = __opts__.get('roster_domain', '')
try:
result = salt.template.compile_template(roster_file,
ren... |
Convert a string to a number, allowing for a K|M|G|T postfix, 32.8K.
Returns a decimal number if the string is a real number,
or the string unchanged otherwise.
def _parse_numbers(text):
'''
Convert a string to a number, allowing for a K|M|G|T postfix, 32.8K.
Returns a decimal number if the string ... |
Sanitize flags passed into df
def _clean_flags(args, caller):
'''
Sanitize flags passed into df
'''
flags = ''
if args is None:
return flags
allowed = ('a', 'B', 'h', 'H', 'i', 'k', 'l', 'P', 't', 'T', 'x', 'v')
for flag in args:
if flag in allowed:
flags += flag... |
Return usage information for volumes mounted on this minion
.. versionchanged:: 2019.2.0
Default for SunOS changed to 1 kilobyte blocks
CLI Example:
.. code-block:: bash
salt '*' disk.usage
def usage(args=None):
'''
Return usage information for volumes mounted on this minion
... |
Return inode usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.inodeusage
def inodeusage(args=None):
'''
Return inode usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.ino... |
Return partition information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.percent /var
def percent(args=None):
'''
Return partition information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.percent ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.