text stringlengths 81 112k |
|---|
Dynamically generate a regex to match pem_type
def _make_regex(pem_type):
'''
Dynamically generate a regex to match pem_type
'''
return re.compile(
r"\s*(?P<pem_header>-----BEGIN {0}-----)\s+"
r"(?:(?P<proc_type>Proc-Type: 4,ENCRYPTED)\s*)?"
r"(?:(?P<dek_info>DEK-Info: (?:DES-[3... |
Returns a properly formatted PEM string from the input text fixing
any whitespace or line-break issues
text:
Text containing the X509 PEM entry to be returned or path to
a file containing the text.
pem_type:
If specified, this function will only return a pem of a certain type,
... |
Returns a dict containing PEM entries in files matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.get_pem_entries "/etc/pki/*.crt"
def get_pem_entries(glob_path):
'''
Returns a dict containing PEM entries in... |
Returns a dict containing details of a certificate. Input can be a PEM
string or file path.
certificate:
The certificate to be read. Can be a path to a certificate file, or
a string containing the PEM formatted text of the certificate.
CLI Example:
.. code-block:: bash
salt '... |
Returns a dict containing details of a all certificates matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.read_certificates "/etc/pki/*.crt"
def read_certificates(glob_path):
'''
Returns a dict containing d... |
Returns a dict containing details of a certificate request.
:depends: - OpenSSL command line tool
csr:
A path or PEM encoded string containing the CSR to read.
CLI Example:
.. code-block:: bash
salt '*' x509.read_csr /etc/pki/mycert.csr
def read_csr(csr):
'''
Returns a di... |
Returns a dict containing details of a certificate revocation list.
Input can be a PEM string or file path.
:depends: - OpenSSL command line tool
csl:
A path or PEM encoded string containing the CSL to read.
CLI Example:
.. code-block:: bash
salt '*' x509.read_crl /etc/pki/myc... |
Returns a string containing the public key in PEM format.
key:
A path or PEM encoded string containing a CSR, Certificate or
Private Key from which a public key can be retrieved.
CLI Example:
.. code-block:: bash
salt '*' x509.get_public_key /etc/pki/mycert.cer
def get_public_ke... |
Writes out a PEM string fixing any formatting or whitespace
issues before writing.
text:
PEM string input to be written out.
path:
Path of the file to write the pem out to.
overwrite:
If True(default), write_pem will overwrite the entire pem file.
Set False to preserve... |
Creates a private key in PEM format.
path:
The path to write the file to, either ``path`` or ``text``
are required.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
bits:
Length of the private key in bits. Default 2048
passp... |
Create a CRL
:depends: - PyOpenSSL Python module
path:
Path to write the crl to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
signing_private_key:
A path or string of the private key in PEM format that will be used
to ... |
Request a certificate to be remotely signed according to a signing policy.
argdic:
A dict containing all the arguments to be passed into the
create_certificate function. This will become kwargs when passed
to create_certificate.
kwargs:
kwargs delivered from publish.publish
... |
Returns the details of a names signing policy, including the text of
the public key that will be used to sign it. Does not return the
private key.
CLI Example:
.. code-block:: bash
salt '*' x509.get_signing_policy www
def get_signing_policy(signing_policy_name):
'''
Returns the detai... |
Create an X509 certificate.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
overwrite:
If True(default), create_certificate will overwrite the entire pem
file. Set False to preserve existi... |
Create a certificate signing request.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
algorithm:
The hashing algorithm to be used for signing this request. Defaults to sha256.
kwargs:
... |
Verify that ``certificate`` has been signed by ``signing_pub_key``
certificate:
The certificate to verify. Can be a path or string containing a
PEM formatted certificate.
signing_pub_key:
The public key to verify, can be a string or path to a PEM formatted
certificate, csr, or ... |
Validate a CRL against a certificate.
Parses openssl command line output, this is a workaround for M2Crypto's
inability to get them from CSR objects.
crl:
The CRL to verify
cert:
The certificate to verify the CRL against
CLI Example:
.. code-block:: bash
salt '*' x50... |
Returns a dict containing limited details of a
certificate and whether the certificate has expired.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path to a certificate file,
or a string containing the PEM formatted text of the certificate.
CLI Example:
... |
Returns a dict containing details of a certificate and whether
the certificate will expire in the specified number of days.
Input can be a PEM string or file path.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path to a certificate file,
or a string cont... |
Connect to a Django database through the ORM and retrieve model fields
:type pillar_name: str
:param pillar_name: The name of the pillar to be returned
:type project_path: str
:param project_path: The full path to your Django project (the directory
manage.py is in)
:type settings_module: ... |
Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains
def list_domains():
'''
Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains
'''
data = __... |
Return VM virtualization type : OS or KVM
CLI Example:
.. code-block:: bash
salt '*' virt.vm_virt_type <domain>
def vm_virt_type(domain):
'''
Return VM virtualization type : OS or KVM
CLI Example:
.. code-block:: bash
salt '*' virt.vm_virt_type <domain>
'''
ret = _... |
Change the amount of memory allocated to VM.
<memory> is to be specified in MB.
Note for KVM : this would require a restart of the VM.
CLI Example:
.. code-block:: bash
salt '*' virt.setmem <domain> 512
def setmem(domain, memory):
'''
Change the amount of memory allocated to VM.
... |
Return a list off MAC addresses from the named VM
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <domain>
def get_macs(domain):
'''
Return a list off MAC addresses from the named VM
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <domain>
'''
mac... |
Return (extremely verbose) map of FACLs on specified file(s)
CLI Examples:
.. code-block:: bash
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
def getfa... |
Parse a single ACL rule
def _parse_acl(acl, user, group):
'''
Parse a single ACL rule
'''
comps = acl.split(':')
vals = {}
# What type of rule is this?
vals['type'] = 'acl'
if comps[0] == 'default':
vals['type'] = 'default'
comps.pop(0)
# If a user is not specified... |
Remove all FACLs from the specified file(s)
CLI Examples:
.. code-block:: bash
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
def wipefacls(*args,... |
Add or modify a FACL for the specified file(s)
CLI Examples:
.. code-block:: bash
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 ... |
Remove specific FACL from the specified file(s)
CLI Examples:
.. code-block:: bash
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... |
Ensure that given user is present.
name
Name of the user to manage
passwd
Password of the user
admin : False
Whether the user should have cluster administration
privileges or not.
grants
Optional - Dict of database:privilege items associated with
the u... |
Activates the firmware backup image.
CLI Example:
Args:
reset(bool): Reset the CIMC device on activate.
.. code-block:: bash
salt '*' cimc.activate_backup_image
salt '*' cimc.activate_backup_image reset=True
def activate_backup_image(reset=False):
'''
Activates the firmw... |
Create a CIMC user with username and password.
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The clear text password of the user.
priv(str): The privilege level of the user.
CLI Example:
.. code-block... |
Mounts a remote file through a remote share. Currently, this feature is supported in version 1.5 or greater.
The remote share can be either NFS, CIFS, or WWW.
Some of the advantages of CIMC Mounted vMedia include:
Communication between mounted media and target stays local (inside datacenter)
Media ... |
Sets the hostname on the server.
.. versionadded:: 2019.2.0
Args:
hostname(str): The new hostname to set.
CLI Example:
.. code-block:: bash
salt '*' cimc.set_hostname foobar
def set_hostname(hostname=None):
'''
Sets the hostname on the server.
.. versionadded:: 2019.2.... |
Sets the logging levels of the CIMC devices. The logging levels must match
the following options: emergency, alert, critical, error, warning, notice,
informational, debug.
.. versionadded:: 2019.2.0
Args:
remote(str): The logging level for SYSLOG logs.
local(str): The logging level fo... |
Sets the NTP servers configuration. This will also enable the client NTP service.
Args:
server1(str): The first IP address or FQDN of the NTP servers.
server2(str): The second IP address or FQDN of the NTP servers.
server3(str): The third IP address or FQDN of the NTP servers.
se... |
Sets the power configuration on the device. This is only available for some
C-Series servers.
.. versionadded:: 2019.2.0
Args:
policy(str): The action to be taken when chassis power is restored after
an unexpected power loss. This can be one of the following:
reset: The server... |
Set the SYSLOG server on the host.
Args:
server(str): The hostname or IP address of the SYSLOG server.
type(str): Specifies the type of SYSLOG server. This can either be primary (default) or secondary.
CLI Example:
.. code-block:: bash
salt '*' cimc.set_syslog_server foo.bar.com... |
Sets a CIMC user with specified configurations.
.. versionadded:: 2019.2.0
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The clear text password of the user.
priv(str): The privilege level of the user.
... |
Update the BIOS firmware through TFTP.
Args:
server(str): The IP address or hostname of the TFTP server.
path(str): The TFTP path and filename for the BIOS image.
CLI Example:
.. code-block:: bash
salt '*' cimc.tftp_update_bios foo.bar.com HP-SL2.cap
def tftp_update_bios(server... |
return True if the acl need to be update, False if it doesn't need to be update
def _acl_changes(name, id=None, type=None, rules=None, consul_url=None, token=None):
'''
return True if the acl need to be update, False if it doesn't need to be update
'''
info = __salt__['consul.acl_info'](id=id, token... |
Check the acl exists by using the name or the ID,
name is ignored if ID is specified,
if only Name is used the ID associated with it is returned
def _acl_exists(name=None, id=None, token=None, consul_url=None):
'''
Check the acl exists by using the name or the ID,
name is ignored if ID ... |
Ensure the ACL is present
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
type: client
Specifies the type of ACL token. Valid values are: client and management.
rules
Specifies rules for this ACL token.
consul_url : http://... |
Ensure the ACL is absent
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
token
token to authenticate you Consul query
consul_url : http://locahost:8500
consul URL to query
.. note::
For more information https://www.... |
Return NVMe NQN
def nvme_nqn():
'''
Return NVMe NQN
'''
grains = {}
grains['nvme_nqn'] = False
if salt.utils.platform.is_linux():
grains['nvme_nqn'] = _linux_nqn()
return grains |
Return NVMe NQN from a Linux host.
def _linux_nqn():
'''
Return NVMe NQN from a Linux host.
'''
ret = []
initiator = '/etc/nvme/hostnqn'
try:
with salt.utils.files.fopen(initiator, 'r') as _nvme:
for line in _nvme:
line = line.strip()
if line... |
Create or manage a java keystore.
name
The path to the keystore file
passphrase
The password to the keystore
entries
A list containing an alias, certificate, and optional private_key.
The certificate and private_key can be a file or a string
.. code-block:: yaml
... |
Disable the Packet Filter.
CLI example:
.. code-block:: bash
salt '*' pf.disable
def disable():
'''
Disable the Packet Filter.
CLI example:
.. code-block:: bash
salt '*' pf.disable
'''
ret = {}
result = __salt__['cmd.run_all']('pfctl -d',
... |
Set the debug level which limits the severity of log messages printed by ``pf(4)``.
level:
Log level. Should be one of the following: emerg, alert, crit, err, warning, notice,
info or debug (OpenBSD); or none, urgent, misc, loud (FreeBSD).
CLI example:
.. code-block:: bash
salt '... |
Load a ruleset from the specific file, overwriting the currently loaded ruleset.
file:
Full path to the file containing the ruleset.
noop:
Don't actually load the rules, just parse them.
CLI example:
.. code-block:: bash
salt '*' pf.load /etc/pf.conf.d/lockdown.conf
def loa... |
Flush the specified packet filter parameters.
modifier:
Should be one of the following:
- all
- info
- osfp
- rules
- sources
- states
- tables
Please refer to the OpenBSD `pfctl(8) <https://man.openbsd.org/pfctl#T>`_
documentation f... |
Apply a command on the specified table.
table:
Name of the table.
command:
Command to apply to the table. Supported commands are:
- add
- delete
- expire
- flush
- kill
- replace
- show
- test
- zero
Please refer... |
Show filter parameters.
modifier:
Modifier to apply for filtering. Only a useful subset of what pfctl supports
can be used with Salt.
- rules
- states
- tables
CLI example:
.. code-block:: bash
salt '*' pf.show rules
def show(modifier):
'''
Show ... |
Create an event on the VictorOps service
.. code-block:: yaml
webserver-warning-message:
victorops.create_event:
- message_type: 'CRITICAL'
- entity_id: 'webserver/diskspace'
- state_message: 'Webserver diskspace is low.'
database-server-warning-messa... |
Set up neutron credentials
def _auth(profile=None):
'''
Set up neutron credentials
'''
if profile:
credentials = __salt__['config.option'](profile)
user = credentials['keystone.user']
password = credentials['keystone.password']
tenant = credentials['keystone.tenant']
... |
Update a tenant's quota
CLI Example:
.. code-block:: bash
salt '*' neutron.update_quota tenant-id subnet=40 router=50
network=10 floatingip=30 port=30
:param tenant_id: ID of tenant
:param subnet: Value of subnet quota (Optional)
:param router: Value o... |
Creates a new port
CLI Example:
.. code-block:: bash
salt '*' neutron.create_port network-name port-name
:param name: Name of port to create
:param network: Network name or ID
:param device_id: ID of device (Optional)
:param admin_state_up: Set admin state up to true or false,
... |
Updates a port
CLI Example:
.. code-block:: bash
salt '*' neutron.update_port port-name network-name new-port-name
:param port: Port name or ID
:param name: Name of this port
:param admin_state_up: Set admin state up to true or false,
default: true (Optional)
:param profi... |
Creates a new network
CLI Example:
.. code-block:: bash
salt '*' neutron.create_network network-name
salt '*' neutron.create_network network-name profile=openstack1
:param name: Name of network to create
:param admin_state_up: should the state of the network be up?
defaul... |
Updates a network
CLI Example:
.. code-block:: bash
salt '*' neutron.update_network network-name new-network-name
:param network: ID or name of network to update
:param name: Name of this network
:param profile: Profile to build on (Optional)
:return: Value of updated network informa... |
Creates a new subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.create_subnet network-name 192.168.1.0/24
:param network: Network ID or name this subnet belongs to
:param cidr: CIDR of subnet to create (Ex. '192.168.1.0/24')
:param name: Name of the subnet to create (Optional)
... |
Updates a subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.update_subnet subnet-name new-subnet-name
:param subnet: ID or name of subnet to update
:param name: Name of this subnet
:param profile: Profile to build on (Optional)
:return: Value of updated subnet information
de... |
Creates a new router
CLI Example:
.. code-block:: bash
salt '*' neutron.create_router new-router-name
:param name: Name of router to create (must be first)
:param ext_network: ID or name of the external for the gateway (Optional)
:param admin_state_up: Set admin state up to true or false... |
Updates a router
CLI Example:
.. code-block:: bash
salt '*' neutron.update_router router_id name=new-router-name
admin_state_up=True
:param router: ID or name of router to update
:param name: Name of this router
:param ext_network: ID or name of the external for the gatew... |
Adds an internal network interface to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID or name of the subnet
:param profile: Profile to build on (Optional)
:r... |
Removes an internal network interface from the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.remove_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID or name of the subnet
:param profile: Profile to build on (Optional... |
Adds an external network gateway to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_gateway_router router-name ext-network-name
:param router: ID or name of the router
:param ext_network: ID or name of the external network the gateway
:param profile: Profile t... |
Creates a new floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.create_floatingip network-name port-name
:param floating_network: Network name or ID to allocate floatingIP from
:param port: Of the port to be associated with the floatingIP (Optional)
:param profile: Profile to... |
Updates a floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.update_floatingip network-name port-name
:param floatingip_id: ID of floatingIP
:param port: ID or name of port, to associate floatingip to `None` or do
not specify to disassociate the floatingip (Optional)
:... |
Creates a new security group
CLI Example:
.. code-block:: bash
salt '*' neutron.create_security_group security-group-name \
description='Security group for servers'
:param name: Name of security group (Optional)
:param description: Description of security group (Optional)
... |
Updates a security group
CLI Example:
.. code-block:: bash
salt '*' neutron.update_security_group security-group-name \
new-security-group-name
:param security_group: ID or name of security group to update
:param name: Name of this security group (Optional)
:param descrip... |
Creates a new security group rule
CLI Example:
.. code-block:: bash
salt '*' neutron.show_security_group_rule security-group-rule-id
:param security_group: Security group name or ID to add rule
:param remote_group_id: Remote security group name or ID to
apply rule (Optional)
... |
Fetches a list of all configured VPN services for a tenant
CLI Example:
.. code-block:: bash
salt '*' neutron.list_vpnservices
:param retrieve_all: True or False, default: True (Optional)
:param profile: Profile to build on (Optional)
:return: List of VPN service
def list_vpnservices(re... |
Fetches information of a specific VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.show_vpnservice vpnservice-name
:param vpnservice: ID or name of vpn service to look up
:param profile: Profile to build on (Optional)
:return: VPN service information
def show_vpnservice(vp... |
Creates a new VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.create_vpnservice router-name name
:param subnet: Subnet unique identifier for the VPN service deployment
:param router: Router unique identifier for the VPN service
:param name: Set a name for the VPN service
... |
Updates a VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1'
:param vpnservice: ID or name of vpn service to update
:param desc: Set a description for the VPN service
:param profile: Profile to build on (Optional)
:ret... |
Creates a new IPsecSiteConnection
CLI Example:
.. code-block:: bash
salt '*' neutron.show_ipsec_site_connection connection-name
ipsec-policy-name ikepolicy-name vpnservice-name
192.168.XXX.XXX/24 192.168.XXX.XXX 192.168.XXX.XXX secret
:param name: Set friendly nam... |
Creates a new IKEPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ikepolicy ikepolicy-name
phase1_negotiation_mode=main auth_algorithm=sha1
encryption_algorithm=aes-128 pfs=group5
:param name: Name of the IKE policy
:param phase1_negotiation_mo... |
Creates a new IPsecPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ipsecpolicy ipsecpolicy-name
transform_protocol=esp auth_algorithm=sha1
encapsulation_mode=tunnel encryption_algorithm=aes-128
:param name: Name of the IPSec policy
:param tran... |
Creates a new firewall rule
CLI Example:
.. code-block:: bash
salt '*' neutron.create_firewall_rule protocol action
tenant_id=TENANT_ID name=NAME description=DESCRIPTION ip_version=IP_VERSION
source_ip_address=SOURCE_IP_ADDRESS destination_ip_address=DESTINATION_IP_ADD... |
Update a firewall rule
CLI Example:
.. code-block:: bash
salt '*' neutron.update_firewall_rule firewall_rule protocol=PROTOCOL action=ACTION
name=NAME description=DESCRIPTION ip_version=IP_VERSION
source_ip_address=SOURCE_IP_ADDRESS destination_ip_address=DESTINATION_I... |
Return a report on all actively running jobs from a job id centric
perspective
CLI Example:
.. code-block:: bash
salt-run jobs.active
def active(display_progress=False):
'''
Return a report on all actively running jobs from a job id centric
perspective
CLI Example:
.. code-... |
Return the printout from a previously executed job
jid
The jid to look up.
ext_source
The external job cache to use. Default: `None`.
returned : True
If ``True``, include the minions that did return from the command.
.. versionadded:: 2015.8.0
missing : False
... |
List a specific job given by its jid
ext_source
If provided, specifies which external job cache to use.
display_progress : False
If ``True``, fire progress events.
.. versionadded:: 2015.8.8
CLI Example:
.. code-block:: bash
salt-run jobs.list_job 201309161255244635... |
List all detectable jobs and associated functions
ext_source
If provided, specifies which external job cache to use.
**FILTER OPTIONS**
.. note::
If more than one of the below options are used, only jobs which match
*all* of the filters will be returned.
search_metadata
... |
List all detectable jobs and associated functions
ext_source
The external job cache to use. Default: `None`.
CLI Example:
.. code-block:: bash
salt-run jobs.list_jobs_filter 50
salt-run jobs.list_jobs_filter 100 filter_find_job=False
def list_jobs_filter(count,
... |
Print a specific job's detail given by it's jid, including the return data.
CLI Example:
.. code-block:: bash
salt-run jobs.print_job 20130916125524463507
def print_job(jid, ext_source=None):
'''
Print a specific job's detail given by it's jid, including the return data.
CLI Example:
... |
Check if a job has been executed and exit successfully
jid
The jid to look up.
ext_source
The external job cache to use. Default: `None`.
CLI Example:
.. code-block:: bash
salt-run jobs.exit_success 20160520145827701627
def exit_success(jid, ext_source=None):
'''
Che... |
.. versionadded:: 2015.8.0
List all detectable jobs and associated functions
CLI Example:
.. code-block:: bash
salt-run jobs.last_run
salt-run jobs.last_run target=nodename
salt-run jobs.last_run function='cmd.run'
salt-run jobs.last_run metadata="{'foo': 'bar'}"
def las... |
Helper to format a job instance
def _format_job_instance(job):
'''
Helper to format a job instance
'''
if not job:
ret = {'Error': 'Cannot contact returner or no job with this jid'}
return ret
ret = {'Function': job.get('fun', 'unknown-function'),
'Arguments': list(job.g... |
Walk through the job dir and return jobs
def _walk_through(job_dir, display_progress=False):
'''
Walk through the job dir and return jobs
'''
serial = salt.payload.Serial(__opts__)
for top in os.listdir(job_dir):
t_path = os.path.join(job_dir, top)
for final in os.listdir(t_path):... |
Trigger an event in IFTTT
.. code-block:: yaml
ifttt-event:
ifttt.trigger_event:
- event: TestEvent
- value1: 'A value that we want to send.'
- value2: 'A second value that we want to send.'
- value3: 'A third value that we want to send.'
The ... |
Ensure the CNAME with the given name or canonical name is removed
def absent(name=None, canonical=None, **api_opts):
'''
Ensure the CNAME with the given name or canonical name is removed
'''
ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}
obj = __salt__['infoblox.get_cname'](nam... |
Get the redis options from salt.
def _get_options(ret=None):
'''
Get the redis options from salt.
'''
attrs = {'host': 'host',
'port': 'port',
'unix_socket_path': 'unix_socket_path',
'db': 'db',
'password': 'password',
'cluster_mode': 'cl... |
Return a redis server object
def _get_serv(ret=None):
'''
Return a redis server object
'''
_options = _get_options(ret)
global REDIS_POOL
if REDIS_POOL:
return REDIS_POOL
elif _options.get('cluster_mode'):
REDIS_POOL = StrictRedisCluster(startup_nodes=_options.get('startup_n... |
Return data to a redis data store
def returner(ret):
'''
Return data to a redis data store
'''
serv = _get_serv(ret)
pipeline = serv.pipeline(transaction=False)
minion, jid = ret['id'], ret['jid']
pipeline.hset('ret:{0}'.format(jid), minion, salt.utils.json.dumps(ret))
pipeline.expire('... |
Save the load to the specified jid
def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
serv = _get_serv(ret=None)
serv.setex('load:{0}'.format(jid), _get_ttl(), salt.utils.json.dumps(load)) |
Return the load data that marks a specified jid
def get_load(jid):
'''
Return the load data that marks a specified jid
'''
serv = _get_serv(ret=None)
data = serv.get('load:{0}'.format(jid))
if data:
return salt.utils.json.loads(data)
return {} |
Return the information returned when the specified job id was executed
def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
serv = _get_serv(ret=None)
ret = {}
for minion, data in six.iteritems(serv.hgetall('ret:{0}'.format(jid))):
if data:
... |
Return a dict of the last function called for all minions
def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
serv = _get_serv(ret=None)
ret = {}
for minion in serv.smembers('minions'):
ind_str = '{0}:{1}'.format(minion, fun)
try:
jid ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.