text stringlengths 81 112k |
|---|
.. versionadded:: 2019.2.0
List all policy assignments for a resource group.
:param resource_group: The resource group name to list policy assignments within.
CLI Example:
.. code-block:: bash
salt-call azurearm_resource.policy_assignments_list_for_resource_group testgroup
def policy_assig... |
.. versionadded:: 2019.2.0
List all policy assignments for a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_resource.policy_assignments_list
def policy_assignments_list(**kwargs):
'''
.. versionadded:: 2019.2.0
List all policy assignments for a subscription.
... |
.. versionadded:: 2019.2.0
Create or update a policy definition.
:param name: The name of the policy definition to create or update.
:param policy_rule: A dictionary defining the
`policy rule <https://docs.microsoft.com/en-us/azure/azure-policy/policy-definition#policy-rule>`_.
CLI Example:
... |
.. versionadded:: 2019.2.0
Delete a policy definition.
:param name: The name of the policy definition to delete.
CLI Example:
.. code-block:: bash
salt-call azurearm_resource.policy_definition_delete testpolicy
def policy_definition_delete(name, **kwargs):
'''
.. versionadded:: 201... |
.. versionadded:: 2019.2.0
Get details about a specific policy definition.
:param name: The name of the policy definition to query.
CLI Example:
.. code-block:: bash
salt-call azurearm_resource.policy_definition_get testpolicy
def policy_definition_get(name, **kwargs):
'''
.. versi... |
.. versionadded:: 2019.2.0
List all policy definitions for a subscription.
:param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result.
CLI Example:
.. code-block:: bash
salt-call azurearm_resource.policy_definitions_list
def policy_definitions_list(hide_b... |
Query an instance upon creation from the Joyent API
def query_instance(vm_=None, call=None):
'''
Query an instance upon creation from the Joyent API
'''
if isinstance(vm_, six.string_types) and call == 'action':
vm_ = {'name': vm_, 'provider': 'joyent'}
if call == 'function':
# Tec... |
Create a single VM from a data dict
CLI Example:
.. code-block:: bash
salt-cloud -p profile_name vm_name
def create(vm_):
'''
Create a single VM from a data dict
CLI Example:
.. code-block:: bash
salt-cloud -p profile_name vm_name
'''
try:
# Check for requi... |
convenience function to make the rest api call for node creation.
def create_node(**kwargs):
'''
convenience function to make the rest api call for node creation.
'''
name = kwargs['name']
size = kwargs['size']
image = kwargs['image']
location = kwargs['location']
networks = kwargs.get(... |
destroy a machine by name
:param name: name given to the machine
:param call: call value in this case is 'action'
:return: array of booleans , true if successfully stopped and true if
successfully removed
CLI Example:
.. code-block:: bash
salt-cloud -d vm_name
def destroy(n... |
reboot a machine by name
:param name: name given to the machine
:param call: call value in this case is 'action'
:return: true if successful
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name
def reboot(name, call=None):
'''
reboot a machine by name
:param name: n... |
take action call used by start,stop, reboot
:param name: name given to the machine
:param call: call value in this case is 'action'
:command: api path
:data: any data to be passed to the api, must be in json format
:method: GET,POST,or DELETE
:location: data center to execute the command on
... |
Return the joyent data center to use, in this order:
- CLI parameter
- VM parameter
- Cloud profile setting
def get_location(vm_=None):
'''
Return the joyent data center to use, in this order:
- CLI parameter
- VM parameter
- Cloud profile setting
'''
ret... |
List all available locations
def avail_locations(call=None):
'''
List all available locations
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
re... |
Find if the provided object has a specific method
def has_method(obj, method_name):
'''
Find if the provided object has a specific method
'''
if method_name in dir(obj):
return True
log.error('Method \'%s\' not yet supported!', method_name)
return False |
convert list to dictionary using the key as the identifier
:param items: array to iterate over
:return: dictionary
def key_list(items=None):
'''
convert list to dictionary using the key as the identifier
:param items: array to iterate over
:return: dictionary
'''
if items is None:
... |
get details about a machine
:param name: name given to the machine
:param call: call value in this case is 'action'
:return: machine information
CLI Example:
.. code-block:: bash
salt-cloud -a show_instance vm_name
def show_instance(name, call=None):
'''
get details about a machi... |
Reformat the returned data from joyent, determine public/private IPs and
strip out fields if necessary to provide either full or brief content.
:param item: node dictionary
:param full: full or brief output
:return: dict
def reformat_node(item=None, full=False):
'''
Reformat the returned data ... |
list of nodes, keeping only a brief listing
CLI Example:
.. code-block:: bash
salt-cloud -Q
def list_nodes(full=False, call=None):
'''
list of nodes, keeping only a brief listing
CLI Example:
.. code-block:: bash
salt-cloud -Q
'''
if call == 'action':
raise... |
Checks configuration to see whether the user has SSL turned on. Default is:
.. code-block:: yaml
use_ssl: True
def _get_proto():
'''
Checks configuration to see whether the user has SSL turned on. Default is:
.. code-block:: yaml
use_ssl: True
'''
use_ssl = config.get_cloud_... |
Get list of available images
CLI Example:
.. code-block:: bash
salt-cloud --list-images
Can use a custom URL for images. Default is:
.. code-block:: yaml
image_url: images.joyent.com/images
def avail_images(call=None):
'''
Get list of available images
CLI Example:
... |
get list of available packages
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes
def avail_sizes(call=None):
'''
get list of available packages
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes
'''
if call == 'action':
raise SaltCloudSystemE... |
List the keys available
def list_keys(kwargs=None, call=None):
'''
List the keys available
'''
if call != 'function':
log.error(
'The list_keys function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
ret = {}
rc... |
List the keys available
def show_key(kwargs=None, call=None):
'''
List the keys available
'''
if call != 'function':
log.error(
'The list_keys function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
if 'keyname' not... |
List the keys available
CLI Example:
.. code-block:: bash
salt-cloud -f import_key joyent keyname=mykey keyfile=/tmp/mykey.pub
def import_key(kwargs=None, call=None):
'''
List the keys available
CLI Example:
.. code-block:: bash
salt-cloud -f import_key joyent keyname=myke... |
Make a web call to Joyent
def query(action=None,
command=None,
args=None,
method='GET',
location=None,
data=None):
'''
Make a web call to Joyent
'''
user = config.get_cloud_config_value(
'user', get_configured_provider(), __opts__, search_global... |
Figure out which utmp file to use when determining runlevel.
Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness.
def _find_utmp():
'''
Figure out which utmp file to use when determining runlevel.
Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness.
'''
result = ... |
Return the current runlevel
def _runlevel():
'''
Return the current runlevel
'''
if 'upstart._runlevel' in __context__:
return __context__['upstart._runlevel']
ret = _default_runlevel()
utmp = _find_utmp()
if utmp:
out = __salt__['cmd.run'](['runlevel', '{0}'.format(utmp)], ... |
An Upstart service is assumed disabled if a manual stanza is
placed in /etc/init/[name].override.
NOTE: An Upstart service can also be disabled by placing "manual"
in /etc/init/[name].conf.
def _upstart_is_disabled(name):
'''
An Upstart service is assumed disabled if a manual stanza is
placed i... |
A System-V style service will have a control script in
/etc/init.d. We make sure to skip over symbolic links that point
to Upstart's /lib/init/upstart-job, and anything that isn't an
executable, like README or skeleton.
def _service_is_sysv(name):
'''
A System-V style service will have a control sc... |
Detect all of the service names available to upstart via init configuration
files and via classic sysv init scripts
def _iter_service_names():
'''
Detect all of the service names available to upstart via init configuration
files and via classic sysv init scripts
'''
found = set()
for line i... |
Return the enabled services
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled
def get_enabled():
'''
Return the enabled services
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled
'''
ret = set()
for name in _iter_service_names():
... |
Return the disabled services
CLI Example:
.. code-block:: bash
salt '*' service.get_disabled
def get_disabled():
'''
Return the disabled services
CLI Example:
.. code-block:: bash
salt '*' service.get_disabled
'''
ret = set()
for name in _iter_service_names():
... |
Disable an Upstart service.
def _upstart_disable(name):
'''
Disable an Upstart service.
'''
if _upstart_is_disabled(name):
return _upstart_is_disabled(name)
override = '/etc/init/{0}.override'.format(name)
with salt.utils.files.fopen(override, 'a') as ofile:
ofile.write(salt.uti... |
Enable an Upstart service.
def _upstart_enable(name):
'''
Enable an Upstart service.
'''
if _upstart_is_enabled(name):
return _upstart_is_enabled(name)
override = '/etc/init/{0}.override'.format(name)
files = ['/etc/init/{0}.conf'.format(name), override]
for file_name in filter(os.p... |
Enable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.enable <service name>
def enable(name, **kwargs):
'''
Enable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.enable <service name>
'''
... |
Disable the named service from starting on boot
CLI Example:
.. code-block:: bash
salt '*' service.disable <service name>
def disable(name, **kwargs):
'''
Disable the named service from starting on boot
CLI Example:
.. code-block:: bash
salt '*' service.disable <service na... |
Check to see if the named service is enabled to start on boot
CLI Example:
.. code-block:: bash
salt '*' service.enabled <service name>
def enabled(name, **kwargs):
'''
Check to see if the named service is enabled to start on boot
CLI Example:
.. code-block:: bash
salt '*'... |
Check to see if the named service is disabled to start on boot
CLI Example:
.. code-block:: bash
salt '*' service.disabled <service name>
def disabled(name):
'''
Check to see if the named service is disabled to start on boot
CLI Example:
.. code-block:: bash
salt '*' servi... |
Grab the YubiKey Client ID & Secret Key
def __get_yubico_users(username):
'''
Grab the YubiKey Client ID & Secret Key
'''
user = {}
try:
if __opts__['yubico_users'].get(username, None):
(user['id'], user['key']) = list(__opts__['yubico_users'][username].values())
else:
... |
Authenticate against yubico server
def auth(username, password):
'''
Authenticate against yubico server
'''
_cred = __get_yubico_users(username)
client = Yubico(_cred['id'], _cred['key'])
try:
return client.verify(password)
except yubico_exceptions.StatusCodeError as e:
lo... |
Format the log record to include exc_info if the handler is enabled for a specific log level
def format(self, record):
'''
Format the log record to include exc_info if the handler is enabled for a specific log level
'''
formatted_record = super(ExcInfoOnLogLevelFormatMixIn, self).format... |
Delete a bucket, or delete an object from a bucket.
CLI Example to delete a bucket::
salt myminion s3.delete mybucket
CLI Example to delete an object from a bucket::
salt myminion s3.delete mybucket remoteobject
def delete(bucket, path=None, action=None, key=None, keyid=None,
ser... |
List the contents of a bucket, or return an object from a bucket. Set
return_bin to True in order to retrieve an object wholesale. Otherwise,
Salt will attempt to parse an XML response.
CLI Example to list buckets:
.. code-block:: bash
salt myminion s3.get
CLI Example to list the content... |
Return the metadata for a bucket, or an object in a bucket.
CLI Examples:
.. code-block:: bash
salt myminion s3.head mybucket
salt myminion s3.head mybucket myfile.png
def head(bucket, path='', key=None, keyid=None, service_url=None,
verify_ssl=None, kms_keyid=None, location=None, r... |
Create a new bucket, or upload an object to a bucket.
CLI Example to create a bucket:
.. code-block:: bash
salt myminion s3.put mybucket
CLI Example to upload an object to a bucket:
.. code-block:: bash
salt myminion s3.put mybucket remotepath local_file=/path/to/file
def put(buck... |
Examine the keys, and populate as necessary
def _get_key(key, keyid, service_url, verify_ssl, kms_keyid, location, role_arn, path_style, https_enable):
'''
Examine the keys, and populate as necessary
'''
if not key and __salt__['config.option']('s3.key'):
key = __salt__['config.option']('s3.key... |
Generate a NT HASH
CLI Example:
.. code-block:: bash
salt '*' pdbedit.generate_nt_hash my_passwd
def generate_nt_hash(password):
'''
Generate a NT HASH
CLI Example:
.. code-block:: bash
salt '*' pdbedit.generate_nt_hash my_passwd
'''
return binascii.hexlify(
... |
List user accounts
verbose : boolean
return all information
hashes : boolean
include NT HASH and LM HASH in verbose output
CLI Example:
.. code-block:: bash
salt '*' pdbedit.list
def list_users(verbose=True, hashes=False):
'''
List user accounts
verbose : boolea... |
Get user account details
login : string
login name
hashes : boolean
include NTHASH and LMHASH in verbose output
CLI Example:
.. code-block:: bash
salt '*' pdbedit.get kaylee
def get_user(login, hashes=False):
'''
Get user account details
login : string
l... |
Delete user account
login : string
login name
CLI Example:
.. code-block:: bash
salt '*' pdbedit.delete wash
def delete(login):
'''
Delete user account
login : string
login name
CLI Example:
.. code-block:: bash
salt '*' pdbedit.delete wash
''... |
Create user account
login : string
login name
password : string
password
password_hashed : boolean
set if password is a nt hash instead of plain text
machine_account : boolean
set to create a machine trust account instead
CLI Example:
.. code-block:: bash
... |
Modify user account
login : string
login name
password : string
password
password_hashed : boolean
set if password is a nt hash instead of plain text
domain : string
users domain
profile : string
profile path
script : string
logon script
drive... |
Check time range
def _validate_time_range(trange, status, msg):
'''
Check time range
'''
# If trange is empty, just return the current status & msg
if not trange:
return status, msg
if not isinstance(trange, dict):
status = False
msg = ('The time_range parameter for '
... |
Validate the beacon configuration
def validate(config):
'''
Validate the beacon configuration
'''
vstatus = True
vmsg = 'Valid beacon configuration'
# Configuration for wtmp beacon should be a list of dicts
if not isinstance(config, list):
vstatus = False
vmsg = ('Configura... |
Ensure the named service is running.
name
Service name as defined in the supervisor configuration file
restart
Whether to force a restart
update
Whether to update the supervisor configuration.
user
Name of the user to run the supervisorctl command
.. versiona... |
Ensure the named service is dead (not running).
name
Service name as defined in the supervisor configuration file
user
Name of the user to run the supervisorctl command
.. versionadded:: 0.17.0
conf_file
path to supervisorctl config file
bin_env
path to super... |
The supervisord watcher, called to invoke the watch command.
Always restart on watch
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being t... |
Render a Cheetah template.
:rtype: A Python data structure
def render(cheetah_data, saltenv='base', sls='', method='xml', **kws):
'''
Render a Cheetah template.
:rtype: A Python data structure
'''
if not HAS_LIBS:
return {}
if not isinstance(cheetah_data, six.string_types):
... |
Get configuration items for URL, Username and Password
def _config():
'''
Get configuration items for URL, Username and Password
'''
status_url = __salt__['config.get']('nagios.status_url') or \
__salt__['config.get']('nagios:status_url')
if not status_url:
raise CommandExecutionErr... |
Send query along to Nagios.
def _status_query(query, hostname, enumerate=None, service=None):
'''
Send query along to Nagios.
'''
config = _config()
data = None
params = {
'hostname': hostname,
'query': query,
}
ret = {
'result': False
}
if enumerate:
... |
Check status of a particular host By default
statuses are returned in a numeric format.
Parameters:
hostname
The hostname to check the status of the service in Nagios.
numeric
Turn to false in order to return status in text format
('OK' instead of 0, 'Warning' instead of 1 etc... |
Check status of a particular service on a host on it in Nagios.
By default statuses are returned in a numeric format.
Parameters:
hostname
The hostname to check the status of the service in Nagios.
service
The service to check the status of in Nagios.
numeric
Turn to fals... |
Set a key/value pair in a keyring service
def set_(key, value, service=None, profile=None):
'''
Set a key/value pair in a keyring service
'''
service = _get_service(service, profile)
keyring.set_password(service, key, value) |
Get a value from a keyring service
def get(key, service=None, profile=None):
'''
Get a value from a keyring service
'''
service = _get_service(service, profile)
return keyring.get_password(service, key) |
Log outcome to sentry. The returner tries to identify errors and report
them as such. All other messages will be reported at info level.
Failed states will be appended as separate list for convenience.
def returner(ret):
'''
Log outcome to sentry. The returner tries to identify errors and report
th... |
Connect to the Sentry server
def _connect_sentry(message, result):
'''
Connect to the Sentry server
'''
pillar_data = __salt__['pillar.raw']()
grains = __salt__['grains.items']()
raven_config = pillar_data['raven']
hide_pillar = raven_config.get('hide_pillar')
sentry_data = {
'r... |
Return a list of registered VMs, with minimal information
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.list_nodes_min
def list_nodes_min():
'''
Return a list of registered VMs, with minimal information
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.list_nod... |
Return a list of registered VMs
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.list_nodes
def list_nodes():
'''
Return a list of registered VMs
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.list_nodes
'''
ret = {}
nodes = list_nodes_full()
fo... |
Start a VM
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.start my_vm
def start(name):
'''
Start a VM
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.start my_vm
'''
ret = {}
cmd = '{0} startvm {1}'.format(vboxcmd(), name)
ret = salt.modules.cm... |
Register a VM
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.register my_vm_filename
def register(filename):
'''
Register a VM
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.register my_vm_filename
'''
if not os.path.isfile(filename):
raise Co... |
Unregister a VM
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.unregister my_vm_filename
def unregister(name, delete=False):
'''
Unregister a VM
CLI Example:
.. code-block:: bash
salt '*' vboxmanage.unregister my_vm_filename
'''
nodes = list_nodes_min()
... |
Create a new VM
CLI Example:
.. code-block:: bash
salt 'hypervisor' vboxmanage.create <name>
def create(name,
groups=None,
ostype=None,
register=True,
basefolder=None,
new_uuid=None,
**kwargs):
'''
Create a new VM
CLI Exa... |
Clone a new VM from an existing VM
CLI Example:
.. code-block:: bash
salt 'hypervisor' vboxmanage.clonevm <name> <new_name>
def clonevm(name=None,
uuid=None,
new_name=None,
snapshot_uuid=None,
snapshot_name=None,
mode='machine',
... |
Clone a new VM from an existing VM
CLI Example:
.. code-block:: bash
salt 'hypervisor' vboxmanage.clonemedium <name> <new_name>
def clonemedium(medium,
uuid_in=None,
file_in=None,
uuid_out=None,
file_out=None,
mformat=No... |
Return a list of a specific type of item. The following items are available:
vms
runningvms
ostypes
hostdvds
hostfloppies
intnets
bridgedifs
hostonlyifs
natnets
dhcpservers
hostinfo
hostcpuids
hddbackends
hd... |
Return strings values as python unicode string
http://www.oracle.com/technetwork/articles/dsl/tuininga-cx-oracle-084866.html
def _unicode_output(cursor, name, default_type, size, precision, scale):
'''
Return strings values as python unicode string
http://www.oracle.com/technetwork/articles/dsl/tuini... |
uri = user/password@host[:port]/sid[servicename as {sysdba|sysoper}]
or
uri = sid[ as {sysdba|sysoper}]
(this syntax only makes sense on non-Windows minions, ORAHOME is taken from oratab)
Return cx_Oracle.Connection instance
def _connect(uri):
'''
uri = user/password@host[:port]/sid[servicen... |
Return ORACLE_HOME for a given SID found in oratab
Note: only works with Unix-like minions
def _parse_oratab(sid):
'''
Return ORACLE_HOME for a given SID found in oratab
Note: only works with Unix-like minions
'''
if __grains__.get('kernel') in ('Linux', 'AIX', 'FreeBSD', 'OpenBSD', 'NetBSD')... |
Run SQL query and return result
CLI Example:
.. code-block:: bash
salt '*' oracle.run_query my_db "select * from my_table"
def run_query(db, query):
'''
Run SQL query and return result
CLI Example:
.. code-block:: bash
salt '*' oracle.run_query my_db "select * from my_tabl... |
Show databases configuration from pillar. Filter by `*args`
CLI Example:
.. code-block:: bash
salt '*' oracle.show_dbs
salt '*' oracle.show_dbs my_db
def show_dbs(*dbs):
'''
Show databases configuration from pillar. Filter by `*args`
CLI Example:
.. code-block:: bash
... |
Server Version (select banner from v$version)
CLI Example:
.. code-block:: bash
salt '*' oracle.version
salt '*' oracle.version my_db
def version(*dbs):
'''
Server Version (select banner from v$version)
CLI Example:
.. code-block:: bash
salt '*' oracle.version
... |
Show Environment used by Oracle Client
CLI Example:
.. code-block:: bash
salt '*' oracle.show_env
.. note::
at first _connect() ``NLS_LANG`` will forced to '.AL32UTF8'
def show_env():
'''
Show Environment used by Oracle Client
CLI Example:
.. code-block:: bash
... |
Retrieve GECOS field info and return it in dictionary form
def _get_gecos(name):
'''
Retrieve GECOS field info and return it in dictionary form
'''
gecos_field = pwd.getpwnam(name).pw_gecos.split(',', 3)
if not gecos_field:
return {}
else:
# Assign empty strings for any unspecif... |
Accepts a dictionary entry containing GECOS field names and their values,
and returns a full GECOS comment string, to be used with usermod.
def _build_gecos(gecos_dict):
'''
Accepts a dictionary entry containing GECOS field names and their values,
and returns a full GECOS comment string, to be used wit... |
Common code to change a user's GECOS information
def _update_gecos(name, key, value):
'''
Common code to change a user's GECOS information
'''
if not isinstance(value, six.string_types):
value = six.text_type(value)
pre_info = _get_gecos(name)
if not pre_info:
return False
i... |
Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <shell>
def add(name,
uid=None,
gid=None,
groups=None,
home=None,
shell=None,
unique=True,
fullname='',
roomnumber='',
... |
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True
def delete(name, remove=False, force=False):
'''
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=Tru... |
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
def chgid(name, gid):
'''
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
'''
pre_info = info(name)
if not pr... |
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
def chshell(name, shell):
'''
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
'''
pre_info = info(nam... |
Set a new home directory for an existing user
name
Username to modify
home
New home directory to set
persist : False
Set to ``True`` to prevent configuration files in the new home
directory from being overwritten by the files from the skeleton
directory.
CLI E... |
Change the groups to which a user belongs
name
Username to modify
groups
List of groups to set for the user. Can be passed as a comma-separated
list or a Python list.
append : False
Set to ``True`` to append these groups to the user's existing list of
groups. Other... |
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
def rename(name, new_name):
'''
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
'''
current_info = in... |
Creates a 'singleton' manager to communicate with a local virtualbox hypervisor.
@return:
@rtype: VirtualBoxManager
def vb_get_manager():
'''
Creates a 'singleton' manager to communicate with a local virtualbox hypervisor.
@return:
@rtype: VirtualBoxManager
'''
global _virtualboxManager... |
Needed for certain operations in the SDK e.g creating sessions
@return:
@rtype: IVirtualBox
def vb_get_box():
'''
Needed for certain operations in the SDK e.g creating sessions
@return:
@rtype: IVirtualBox
'''
vb_get_manager()
try:
# This works in older versions of the SDK,... |
Max number of slots any machine can have
@return:
@rtype: number
def vb_get_max_network_slots():
'''
Max number of slots any machine can have
@return:
@rtype: number
'''
sysprops = vb_get_box().systemProperties
totals = [
sysprops.getMaxNetworkAdapters(adapter_type)
... |
A valid machine_name or a machine is needed to make this work!
@param machine_name:
@type machine_name: str
@param machine:
@type machine: IMachine
@return: INetorkAdapter's converted to dicts
@rtype: [dict]
def vb_get_network_adapters(machine_name=None, machine=None):
'''
A valid mach... |
Wait until a machine has a network address to return or quit after the timeout
@param timeout: in seconds
@type timeout: float
@param step: How regularly we want to check for ips (in seconds)
@type step: float
@param machine_name:
@type machine_name: str
@param machine:
@type machine: I... |
Waits until a session state has been reached, checking at regular intervals.
@param xp_session:
@type xp_session: ISession from the Virtualbox API
@param state: The constant descriptor according to the docs
@type state: str
@param timeout: in seconds
@type timeout: int | float
@param step: ... |
TODO distinguish between private and public addresses
A valid machine_name or a machine is needed to make this work!
!!!
Guest prerequisite: GuestAddition
!!!
Thanks to Shrikant Havale for the StackOverflow answer http://stackoverflow.com/a/29335390
More information on guest properties: http... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.