text stringlengths 81 112k |
|---|
Return a list of all VMs and templates that are on the specified provider, with basic fields
CLI Example:
.. code-block:: bash
salt-cloud -f list_nodes my-vmware-config
To return a list of all VMs and templates present on ALL configured providers, with basic
fields:
CLI Example:
..... |
Return a list of all VMs and templates that are on the specified provider, with fields
specified under ``query.selection`` in ``/etc/salt/cloud``
CLI Example:
.. code-block:: bash
salt-cloud -f list_nodes_select my-vmware-config
To return a list of all VMs and templates present on ALL config... |
List all available details of the specified VM
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vmname
def show_instance(name, call=None):
'''
List all available details of the specified VM
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vmname
... |
Return a list of all the templates present in this VMware environment with basic
details
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-vmware-config
def avail_images(call=None):
'''
Return a list of all the templates present in this VMware environment with basic
detai... |
List all the folders for this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f list_folders my-vmware-config
def list_folders(kwargs=None, call=None):
'''
List all the folders for this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f lis... |
List snapshots either for all VMs and templates or for a specific VM/template
in this VMware environment
To list snapshots for all VMs and templates:
CLI Example:
.. code-block:: bash
salt-cloud -f list_snapshots my-vmware-config
To list snapshots for a specific VM/template:
CLI Ex... |
To suspend a VM using its name
CLI Example:
.. code-block:: bash
salt-cloud -a suspend vmname
def suspend(name, call=None):
'''
To suspend a VM using its name
CLI Example:
.. code-block:: bash
salt-cloud -a suspend vmname
'''
if call != 'action':
raise Salt... |
To reset a VM using its name
.. note::
If ``soft=True`` then issues a command to the guest operating system
asking it to perform a reboot. Otherwise hypervisor will terminate VM and start it again.
Default is soft=False
For ``soft=True`` vmtools should be installed on guest system... |
To do an immediate power off of a VM using its name. A ``SIGKILL``
is issued to the vmx process of the VM
CLI Example:
.. code-block:: bash
salt-cloud -a terminate vmname
def terminate(name, call=None):
'''
To do an immediate power off of a VM using its name. A ``SIGKILL``
is issued ... |
To destroy a VM from the VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -d vmname
salt-cloud --destroy vmname
salt-cloud -a destroy vmname
def destroy(name, call=None):
'''
To destroy a VM from the VMware environment
CLI Example:
.. code-block:: bas... |
To create a single VM in the VMware environment.
Sample profile and arguments that can be specified in it can be found
:ref:`here. <vmware-cloud-profile>`
CLI Example:
.. code-block:: bash
salt-cloud -p vmware-centos6.5 vmname
def create(vm_):
'''
To create a single VM in the VMware... |
Returns a clone spec for cloning from shapshots
:rtype vim.vm.CloneSpec
def handle_snapshot(config_spec, object_ref, reloc_spec, template, vm_):
'''
Returns a clone spec for cloning from shapshots
:rtype vim.vm.CloneSpec
'''
if 'snapshot' not in vm_:
return None
allowed_types = [
... |
return clonespec only if values are valid
def get_clonespec_for_valid_snapshot(config_spec, object_ref, reloc_spec, template, vm_):
'''
return clonespec only if values are valid
'''
moving = True
if QUICK_LINKED_CLONE == vm_['snapshot']['disk_move_type']:
reloc_spec.diskMoveType = QUICK_LIN... |
Returns the clone spec
def build_clonespec(config_spec, object_ref, reloc_spec, template):
'''
Returns the clone spec
'''
if reloc_spec.diskMoveType == QUICK_LINKED_CLONE:
return vim.vm.CloneSpec(
template=template,
location=reloc_spec,
config=config_spec,
... |
Create a new data center in this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f create_datacenter my-vmware-config name="MyNewDatacenter"
def create_datacenter(kwargs=None, call=None):
'''
Create a new data center in this VMware environment
CLI Example:
.. code-... |
Create a new cluster under the specified datacenter in this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f create_cluster my-vmware-config name="myNewCluster" datacenter="datacenterName"
def create_cluster(kwargs=None, call=None):
'''
Create a new cluster under the specif... |
To rescan a specified HBA or all the HBAs on the Host System
CLI Example:
.. code-block:: bash
salt-cloud -f rescan_hba my-vmware-config host="hostSystemName"
salt-cloud -f rescan_hba my-vmware-config hba="hbaDeviceName" host="hostSystemName"
def rescan_hba(kwargs=None, call=None):
'''
... |
To upgrade VMware Tools on all virtual machines present in
the specified provider
.. note::
If the virtual machine is running Windows OS, this function
will attempt to suppress the automatic reboot caused by a
VMware Tools upgrade.
CLI Example:
.. code-block:: bash
s... |
To upgrade VMware Tools on a specified virtual machine.
.. note::
If the virtual machine is running Windows OS, use ``reboot=True``
to reboot the virtual machine after VMware tools upgrade. Default
is ``reboot=False``
CLI Example:
.. code-block:: bash
salt-cloud -a upgra... |
List hosts for each cluster; or hosts for a specified cluster in
this VMware environment
To list hosts for each cluster:
CLI Example:
.. code-block:: bash
salt-cloud -f list_hosts_by_cluster my-vmware-config
To list hosts for a specified cluster:
CLI Example:
.. code-block:: b... |
List clusters for each datacenter; or clusters for a specified datacenter in
this VMware environment
To list clusters for each datacenter:
CLI Example:
.. code-block:: bash
salt-cloud -f list_clusters_by_datacenter my-vmware-config
To list clusters for a specified datacenter:
CLI E... |
List all HBAs for each host system; or all HBAs for a specified host
system; or HBAs of specified type for each host system; or HBAs of
specified type for a specified host system in this VMware environment
.. note::
You can specify type as either ``parallel``, ``iscsi``, ``block``
or ``fib... |
List all the distributed virtual switches for this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f list_dvs my-vmware-config
def list_dvs(kwargs=None, call=None):
'''
List all the distributed virtual switches for this VMware environment
CLI Example:
.. code-block... |
List all the vApps for this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f list_vapps my-vmware-config
def list_vapps(kwargs=None, call=None):
'''
List all the vApps for this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f list_vapps ... |
To put the specified host system in maintenance mode in this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f enter_maintenance_mode my-vmware-config host="myHostSystemName"
def enter_maintenance_mode(kwargs=None, call=None):
'''
To put the specified host system in maintena... |
Create the specified folder path in this VMware environment
.. note::
To create a Host and Cluster Folder under a Datacenter, specify
``path="/yourDatacenterName/host/yourFolderName"``
To create a Network Folder under a Datacenter, specify
``path="/yourDatacenterName/network/yourF... |
Create a snapshot of the specified virtual machine in this VMware
environment
.. note::
If the VM is powered on, the internal state of the VM (memory
dump) is included in the snapshot by default which will also set
the power state of the snapshot to "powered on". You can set
``... |
Revert virtual machine to it's current snapshot. If no snapshot
exists, the state of the virtual machine remains unchanged
.. note::
The virtual machine will be powered on if the power state of
the snapshot when it was created was set to "Powered On". Set
``power_off=True`` so that the... |
Remove a snapshot of the specified virtual machine in this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -a remove_snapshot vmname snapshot_name="mySnapshot"
salt-cloud -a remove_snapshot vmname snapshot_name="mySnapshot" [remove_children="True"]
def remove_snapshot(name, k... |
Remove all the snapshots present for the specified virtual machine.
.. note::
All the snapshots higher up in the hierarchy of the current snapshot tree
are consolidated and their virtual disks are merged. To override this
behavior and only remove all snapshots, set ``merge_snapshots=False`... |
Convert the specified virtual machine to template.
CLI Example:
.. code-block:: bash
salt-cloud -a convert_to_template vmname
def convert_to_template(name, kwargs=None, call=None):
'''
Convert the specified virtual machine to template.
CLI Example:
.. code-block:: bash
sal... |
Add a host system to the specified cluster or datacenter in this VMware environment
.. note::
To use this function, you need to specify ``esxi_host_user`` and
``esxi_host_password`` under your provider configuration set up at
``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/v... |
Remove the specified host system from this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f remove_host my-vmware-config host="myHostSystemName"
def remove_host(kwargs=None, call=None):
'''
Remove the specified host system from this VMware environment
CLI Example:
... |
Connect the specified host system in this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f connect_host my-vmware-config host="myHostSystemName"
def connect_host(kwargs=None, call=None):
'''
Connect the specified host system in this VMware environment
CLI Example:
... |
Create a new datastore cluster for the specified datacenter in this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f create_datastore_cluster my-vmware-config name="datastoreClusterName" datacenter="datacenterName"
def create_datastore_cluster(kwargs=None, call=None):
'''
C... |
Shut down the specified host system in this VMware environment
.. note::
If the host system is not in maintenance mode, it will not be shut down. If you
want to shut down the host system regardless of whether it is in maintenance mode,
set ``force=True``. Default is ``force=False``.
C... |
Creates a new usermacro.
:param name: name of the usermacro
:param value: value of the usermacro
:param hostid: id's of the hosts to apply the usermacro on, if missing a global usermacro is assumed.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstr... |
Ensures that the mediatype does not exist, eventually deletes the mediatype.
:param name: name of the usermacro
:param hostid: id's of the hosts to apply the usermacro on, if missing a global usermacro is assumed.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see modu... |
Return the DIFFERENCE of the result sets returned by each matching minion
pool
.. versionadded:: 2014.7.0
These pools are determined from the aggregated and sorted results of
a salt command.
This command displays the "diffs" as a series of 2-way differences --
namely the difference between th... |
A helper function which returns a dictionary of minion pools along with
their matching result sets.
Useful for developing other "survey style" functions.
Optionally accepts a "survey_sort=up" or "survey_sort=down" kwargs for
specifying sort order.
Because the kwargs namespace of the "salt" and "surv... |
Ensures that the artifact from artifactory exists at given location. If it doesn't exist, then
it will be downloaded. If it already exists then the checksum of existing file is checked against checksum
in artifactory. If it is different then the step will fail.
artifact
Details of the artifact to b... |
Performs the same task as saltutil.sync_all module
See :mod:`saltutil module for full list of options <salt.modules.saltutil>`
.. code-block:: yaml
sync_everything:
saltutil.sync_all:
- refresh: True
def sync_all(name, **kwargs):
'''
Performs the same task as saltutil.sy... |
Slack object method function to construct and execute on the API URL.
:param api_key: The Random.org api key.
:param api_version: The version of Random.org api.
:param data: The data to be sent for POST method.
:return: The json response from the API call or False.
def _query(api... |
Show current usages statistics
:param api_key: The Random.org api key.
:param api_version: The Random.org api version.
:return: The current usage statistics.
CLI Example:
.. code-block:: bash
salt '*' random_org.getUsage
salt '*' random_org.getUsage api_key=peWcBiMOS9HrZG15peWcB... |
Generate random integers
:param api_key: The Random.org api key.
:param api_version: The Random.org api version.
:param number: The number of integers to generate
:param minimum: The lower boundary for the range from which the
random numbers will be picked. Must be within
... |
Add `key` as an item to this OrderedSet, then return its index.
If `key` is already in the OrderedSet, return the index it already
had.
def add(self, key):
"""
Add `key` as an item to this OrderedSet, then return its index.
If `key` is already in the OrderedSet, return the ind... |
Get the index of a given entry, raising an IndexError if it's not
present.
`key` can be an iterable of entries that is not a string, in which case
this returns a list of indices.
def index(self, key):
"""
Get the index of a given entry, raising an IndexError if it's not
... |
Remove an element. Do not raise an exception if absent.
The MutableSet mixin uses this to implement the .remove() method, which
*does* raise an error when asked to remove a non-existent item.
def discard(self, key):
"""
Remove an element. Do not raise an exception if absent.
... |
.. versionadded:: 2014.1.0
.. versionchanged:: 2015.8.4
This runner function now supports the :ref:`git_pillar
configuration schema <git-pillar-configuration>` introduced in
2015.8.0. Additionally, the branch and repo can now be omitted to
update all git_pillar remotes. The return d... |
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name, 'changes': {}, 'result... |
Returns a dict where the key is the daemon's name and
the value a boolean indicating its status (True: enabled or False: disabled).
Check the daemons started by the system in /etc/rc and
configured in /etc/rc.conf and /etc/rc.conf.local.
Also add to the dict all the localy enabled daemons via $pkg_scrip... |
.. versionadded:: 2014.7.0
Returns ``True`` if the specified service is available, otherwise returns
``False``.
CLI Example:
.. code-block:: bash
salt '*' service.available sshd
def available(name):
'''
.. versionadded:: 2014.7.0
Returns ``True`` if the specified service is ava... |
.. versionadded:: 2014.7.0
Return all available boot services
CLI Example:
.. code-block:: bash
salt '*' service.get_all
def get_all():
'''
.. versionadded:: 2014.7.0
Return all available boot services
CLI Example:
.. code-block:: bash
salt '*' service.get_all
... |
.. versionadded:: 2014.7.0
Return a set of services that are installed but disabled
CLI Example:
.. code-block:: bash
salt '*' service.get_disabled
def get_disabled():
'''
.. versionadded:: 2014.7.0
Return a set of services that are installed but disabled
CLI Example:
.. ... |
Ensure that the named user is present with the specified properties. A
passwordless user can be configured by omitting ``password`` and
``password_hash``, and setting ``allow_passwordless`` to ``True``.
name
The name of the user to manage
host
Host for which this user/password combo ap... |
Edit an ini file, replacing one or more sections. Returns a dictionary
containing the changes made.
file_name
path of ini_file
sections : None
A dictionary representing the sections to be edited ini file
The keys are the section names and the values are the dictionary
conta... |
Get value of a key from a section in an ini file. Returns ``None`` if
no matching key was found.
API Example:
.. code-block:: python
import salt
sc = salt.client.get_local_client()
sc.cmd('target', 'ini.get_option',
[path_to_ini_file, section_name, option])
CLI... |
Remove a key/value pair from a section in an ini file. Returns the value of
the removed key, or ``None`` if nothing was removed.
API Example:
.. code-block:: python
import salt
sc = salt.client.get_local_client()
sc.cmd('target', 'ini.remove_option',
[path_to_ini_fi... |
Retrieve a section from an ini file. Returns the section as dictionary. If
the section is not found, an empty dictionary is returned.
API Example:
.. code-block:: python
import salt
sc = salt.client.get_local_client()
sc.cmd('target', 'ini.get_section',
[path_to_ini... |
Remove a section in an ini file. Returns the removed section as dictionary,
or ``None`` if nothing was removed.
API Example:
.. code-block:: python
import salt
sc = salt.client.get_local_client()
sc.cmd('target', 'ini.remove_section',
[path_to_ini_file, section_name... |
Retrieve whole structure from an ini file and return it as dictionary.
API Example:
.. code-block:: python
import salt
sc = salt.client.get_local_client()
sc.cmd('target', 'ini.get_ini',
[path_to_ini_file])
CLI Example:
.. code-block:: bash
salt '*' i... |
Render the python module's components
:rtype: string
def render(template, saltenv='base', sls='', tmplpath=None, **kws):
'''
Render the python module's components
:rtype: string
'''
template = tmplpath
if not os.path.isfile(template):
raise SaltRenderError('Template {0} is not a f... |
Ensure the RabbitMQ VHost exists.
name
VHost name
user
Initial user permission to set on the VHost, if present
.. deprecated:: 2015.8.0
owner
Initial owner permission to set on the VHost, if present
.. deprecated:: 2015.8.0
conf
Initial conf string to ... |
properties = {}
def property_present(properties, admin_username='root', admin_password='calvin', host=None, **kwargs):
'''
properties = {}
'''
ret = {'name': host,
'context': {'Host': host},
'result': True,
'changes': {},
'comment': ''}
if host is None:... |
Execute svn
return the output of the command
cmd
The command to run.
cwd
The path to the Subversion repository
user
Run svn as a user other than what the minion runs as
username
Connect to the Subversion server as another user
password
Connect to the ... |
Display the Subversion information from the checkout.
cwd
The path to the Subversion repository
targets : None
files, directories, and URLs to pass to the command as arguments
svn uses '.' by default
user : None
Run svn as a user other than what the minion runs as
use... |
Download a working copy of the remote Subversion repository
directory or file
cwd
The path to the Subversion repository
remote : None
URL to checkout
target : None
The name to give the file or directory working copy
Default: svn uses the remote basename
user : Non... |
Update the current directory, files, or directories from
the remote Subversion repository
cwd
The path to the Subversion repository
targets : None
files and directories to pass to the command as arguments
Default: svn uses '.'
user : None
Run svn as a user other than w... |
Create an unversioned copy of a tree.
cwd
The path to the Subversion repository
remote : None
URL and path to file or directory checkout
target : None
The name to give the file or directory working copy
Default: svn uses the remote basename
user : None
Run svn... |
Given bytes, bytearray, str, or unicode (python 2), return bytes (str for
python 2)
def to_bytes(s, encoding=None, errors='strict'):
'''
Given bytes, bytearray, str, or unicode (python 2), return bytes (str for
python 2)
'''
if encoding is None:
# Try utf-8 first, and fall back to detec... |
Given str, bytes, bytearray, or unicode (py2), return str
def to_str(s, encoding=None, errors='strict', normalize=False):
'''
Given str, bytes, bytearray, or unicode (py2), return str
'''
def _normalize(s):
try:
return unicodedata.normalize('NFC', s) if normalize else s
exce... |
Convert the string name of a boolean to that boolean value.
def to_bool(text):
'''
Convert the string name of a boolean to that boolean value.
'''
downcased_text = six.text_type(text).strip().lower()
if downcased_text == 'false':
return False
elif downcased_text == 'true':
retu... |
Return a single or double quote, if a string is wrapped in extra quotes.
Otherwise return an empty string.
def is_quoted(value):
'''
Return a single or double quote, if a string is wrapped in extra quotes.
Otherwise return an empty string.
'''
ret = ''
if isinstance(value, six.string_types)... |
Detects if the passed string of data is binary or text
def is_binary(data):
'''
Detects if the passed string of data is binary or text
'''
if not data or not isinstance(data, (six.string_types, six.binary_type)):
return False
if isinstance(data, six.binary_type):
if b'\0' in data:
... |
Given a human-readable byte string (e.g. 2G, 30M),
return the number of bytes. Will return 0 if the argument has
unexpected form.
.. versionadded:: 2018.3.0
def human_to_bytes(size):
'''
Given a human-readable byte string (e.g. 2G, 30M),
return the number of bytes. Will return 0 if the argum... |
Create a regular expression at runtime which should match ignoring the
addition or deletion of white space or line breaks, unless between commas
Example:
.. code-block:: python
>>> import re
>>> import salt.utils.stringutils
>>> regex = salt.utils.stringutils.build_whitespace_spli... |
Checks whether or not the passed value matches the specified expression.
Tries to match expr first as a glob using fnmatch.fnmatch(), and then tries
to match expr as a regular expression. Originally designed to match minion
IDs for whitelists/blacklists.
Note that this also does exact matches, as fnmat... |
Check a whitelist and/or blacklist to see if the value matches it.
value
The item to check the whitelist and/or blacklist against.
whitelist
The list of items that are white-listed. If ``value`` is found
in the whitelist, then the function returns ``True``. Otherwise,
it return... |
Check for glob or regexp patterns for include_pat and exclude_pat in the
'path_str' string and return True/False conditions as follows.
- Default: return 'True' if no include_pat or exclude_pat patterns are
supplied
- If only include_pat or exclude_pat is supplied: return 'True' if string
... |
Wrapper around print() that suppresses tracebacks on broken pipes (i.e.
when salt output is piped to less and less is stopped prematurely).
def print_cli(msg, retries=10, step=0.01):
'''
Wrapper around print() that suppresses tracebacks on broken pipes (i.e.
when salt output is piped to less and less i... |
Returns debugging context around a line in a given string
Returns:: string
def get_context(template, line, num_lines=5, marker=None):
'''
Returns debugging context around a line in a given string
Returns:: string
'''
template_lines = template.splitlines()
num_template_lines = len(template... |
Perform diff on two iterables containing lines from two files, and return
the diff as as string. Lines are normalized to str types to avoid issues
with unicode on PY2.
def get_diff(a, b, *args, **kwargs):
'''
Perform diff on two iterables containing lines from two files, and return
the diff as as s... |
Converts camelCase (or CamelCase) to snake_case.
From https://codereview.stackexchange.com/questions/185966/functions-to-convert-camelcase-strings-to-snake-case
:param str camel_input: The camelcase or CamelCase string to convert to snake_case
:return str
def camel_to_snake_case(camel_input):
'''
... |
Converts snake_case to camelCase (or CamelCase if uppercamel is ``True``).
Inspired by https://codereview.stackexchange.com/questions/85311/transform-snake-case-to-camelcase
:param str snake_input: The input snake_case string to convert to camelCase
:param bool uppercamel: Whether or not to convert to Came... |
Queries the specified network device for rx/tx ring parameter information
CLI Example:
.. code-block:: bash
salt '*' ethtool.show_ring <devname>
def show_ring(devname):
'''
Queries the specified network device for rx/tx ring parameter information
CLI Example:
.. code-block:: bash
... |
Queries the specified network device for coalescing information
CLI Example:
.. code-block:: bash
salt '*' ethtool.show_coalesce <devname>
def show_coalesce(devname):
'''
Queries the specified network device for coalescing information
CLI Example:
.. code-block:: bash
salt... |
Queries the specified network device for associated driver information
CLI Example:
.. code-block:: bash
salt '*' ethtool.show_driver <devname>
def show_driver(devname):
'''
Queries the specified network device for associated driver information
CLI Example:
.. code-block:: bash
... |
Changes the rx/tx ring parameters of the specified network device
CLI Example:
.. code-block:: bash
salt '*' ethtool.set_ring <devname> [rx=N] [rx_mini=N] [rx_jumbo=N] [tx=N]
def set_ring(devname, **kwargs):
'''
Changes the rx/tx ring parameters of the specified network device
CLI Examp... |
Changes the coalescing settings of the specified network device
CLI Example:
.. code-block:: bash
salt '*' ethtool.set_coalesce <devname> [adaptive_rx=on|off] [adaptive_tx=on|off] [rx_usecs=N] [rx_frames=N]
[rx_usecs_irq=N] [rx_frames_irq=N] [tx_usecs=N] [tx_frames=N] [tx_usecs_irq=N] [tx... |
Queries the specified network device for the state of protocol offload and other features
CLI Example:
.. code-block:: bash
salt '*' ethtool.show_offload <devname>
def show_offload(devname):
'''
Queries the specified network device for the state of protocol offload and other features
CL... |
Changes the offload parameters and other features of the specified network device
CLI Example:
.. code-block:: bash
salt '*' ethtool.set_offload <devname> tcp_segmentation_offload=on
def set_offload(devname, **kwargs):
'''
Changes the offload parameters and other features of the specified ne... |
Return a Unix timestamp as a string of digits
:return:
def _microtime():
'''
Return a Unix timestamp as a string of digits
:return:
'''
val1, val2 = math.modf(time.time())
val2 = int(val2)
return '{0:f}{1}'.format(val1, val2) |
Return the base path for certs from CLI or from options
cacert_path
absolute path to ca certificates root directory
CLI Example:
.. code-block:: bash
salt '*' tls.cert_base_path
def cert_base_path(cacert_path=None):
'''
Return the base path for certs from CLI or from options
... |
Return a serial number in hex using os.urandom() and a Unix timestamp
in microseconds.
ca_name
name of the CA
CN
common name in the request
def _new_serial(ca_name):
'''
Return a serial number in hex using os.urandom() and a Unix timestamp
in microseconds.
ca_name
... |
Get basic info to write out to the index.txt
def _get_basic_info(ca_name, cert, ca_dir=None):
'''
Get basic info to write out to the index.txt
'''
if ca_dir is None:
ca_dir = '{0}/{1}'.format(_cert_base_path(), ca_name)
index_file = "{0}/index.txt".format(ca_dir)
cert = _read_cert(cer... |
write out the index.txt database file in the appropriate directory to
track certificates
ca_name
name of the CA
cert
certificate to be recorded
def _write_cert_to_database(ca_name, cert, cacert_path=None, status='V'):
'''
write out the index.txt database file in the appropriate dir... |
Check that the X509 version is correct
(was incorrectly set in previous salt versions).
This will fix the version if needed.
ca_name
ca authority name
cacert_path
absolute path to ca certificates root directory
ca_filename
alternative filename for the CA
.. versiona... |
Verify whether a Certificate Authority (CA) already exists
ca_name
name of the CA
cacert_path
absolute path to ca certificates root directory
ca_filename
alternative filename for the CA
.. versionadded:: 2015.5.3
CLI Example:
.. code-block:: bash
salt '*... |
Get the certificate path or content
ca_name
name of the CA
as_text
if true, return the certificate content instead of the path
cacert_path
absolute path to ca certificates root directory
CLI Example:
.. code-block:: bash
salt '*' tls.get_ca test_ca as_text=False c... |
Get the certificate path or content
ca_name
name of the CA
CN
common name of the certificate
as_text
if true, return the certificate content instead of the path
cacert_path
absolute path to certificates root directory
key_filename
alternative filename for the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.