text stringlengths 81 112k |
|---|
.. versionadded:: 2015.8.0
Show a container associated with the storage account
CLI Example:
.. code-block:: bash
salt-cloud -f show_storage_container my-azure name=myservice
name:
Name of container to show.
def show_storage_container(kwargs=None, storage_conn=None, call=None):
... |
.. versionadded:: 2015.8.0
Show a storage container's metadata
CLI Example:
.. code-block:: bash
salt-cloud -f show_storage_container_metadata my-azure name=myservice
name:
Name of container to show.
lease_id:
If specified, show_storage_container_metadata only succeeds i... |
.. versionadded:: 2015.8.0
Set a storage container's metadata
CLI Example:
.. code-block:: bash
salt-cloud -f set_storage_container my-azure name=mycontainer \\
x_ms_meta_name_values='{"my_name": "my_value"}'
name:
Name of existing container.
meta_name_values:
... |
.. versionadded:: 2015.8.0
Show a storage container's acl
CLI Example:
.. code-block:: bash
salt-cloud -f show_storage_container_acl my-azure name=myservice
name:
Name of existing container.
lease_id:
If specified, show_storage_container_acl only succeeds if the
... |
.. versionadded:: 2015.8.0
Set a storage container's acl
CLI Example:
.. code-block:: bash
salt-cloud -f set_storage_container my-azure name=mycontainer
name:
Name of existing container.
signed_identifiers:
SignedIdentifers instance
blob_public_access:
Option... |
.. versionadded:: 2015.8.0
Delete a container associated with the storage account
CLI Example:
.. code-block:: bash
salt-cloud -f delete_storage_container my-azure name=mycontainer
name:
Name of container to create.
fail_not_exist:
Specify whether to throw an exception w... |
.. versionadded:: 2015.8.0
Lease a container associated with the storage account
CLI Example:
.. code-block:: bash
salt-cloud -f lease_storage_container my-azure name=mycontainer
name:
Name of container to create.
lease_action:
Required. Possible values: acquire|renew|re... |
.. versionadded:: 2015.8.0
List blobs associated with the container
CLI Example:
.. code-block:: bash
salt-cloud -f list_blobs my-azure container=mycontainer
container:
The name of the storage container
prefix:
Optional. Filters the results to return only blobs whose nam... |
.. versionadded:: 2015.8.0
Show a blob's service properties
CLI Example:
.. code-block:: bash
salt-cloud -f show_blob_service_properties my-azure
def show_blob_service_properties(kwargs=None, storage_conn=None, call=None):
'''
.. versionadded:: 2015.8.0
Show a blob's service proper... |
.. versionadded:: 2015.8.0
Sets the properties of a storage account's Blob service, including
Windows Azure Storage Analytics. You can also use this operation to
set the default request version for all incoming requests that do not
have a version specified.
CLI Example:
.. code-block:: bash
... |
.. versionadded:: 2015.8.0
Returns all user-defined metadata, standard HTTP properties, and
system properties for the blob.
CLI Example:
.. code-block:: bash
salt-cloud -f show_blob_properties my-azure container=mycontainer blob=myblob
container:
Name of existing container.
... |
.. versionadded:: 2015.8.0
Set a blob's properties
CLI Example:
.. code-block:: bash
salt-cloud -f set_blob_properties my-azure
container:
Name of existing container.
blob:
Name of existing blob.
blob_cache_control:
Optional. Modifies the cache control string... |
.. versionadded:: 2015.8.0
Upload a blob
CLI Examples:
.. code-block:: bash
salt-cloud -f put_blob my-azure container=base name=top.sls blob_path=/srv/salt/top.sls
salt-cloud -f put_blob my-azure container=base name=content.txt blob_content='Some content'
container:
Name of ... |
Perform a query directly against the Azure REST API
def query(path, method='GET', data=None, params=None, header_dict=None, decode=True):
'''
Perform a query directly against the Azure REST API
'''
certificate_path = config.get_cloud_config_value(
'certificate_path',
get_configured_prov... |
Starts service via daemontools
CLI Example:
.. code-block:: bash
salt '*' daemontools.start <service name>
def start(name):
'''
Starts service via daemontools
CLI Example:
.. code-block:: bash
salt '*' daemontools.start <service name>
'''
__salt__['file.remove']('{... |
Stops service via daemontools
CLI Example:
.. code-block:: bash
salt '*' daemontools.stop <service name>
def stop(name):
'''
Stops service via daemontools
CLI Example:
.. code-block:: bash
salt '*' daemontools.stop <service name>
'''
__salt__['file.touch']('{0}/dow... |
Send a TERM to service via daemontools
CLI Example:
.. code-block:: bash
salt '*' daemontools.term <service name>
def term(name):
'''
Send a TERM to service via daemontools
CLI Example:
.. code-block:: bash
salt '*' daemontools.term <service name>
'''
cmd = 'svc -t... |
Return the status for a service via daemontools, return pid if running
CLI Example:
.. code-block:: bash
salt '*' daemontools.status <service name>
def status(name, sig=None):
'''
Return the status for a service via daemontools, return pid if running
CLI Example:
.. code-block:: ba... |
Return True if the named service is enabled, false otherwise
A service is considered enabled if in your service directory:
- an executable ./run file exist
- a file named "down" does not exist
.. versionadded:: 2015.5.7
name
Service name
CLI Example:
.. code-block:: bash
... |
r'''
Check that the key is found in the registry. This refers to keys and not
value/data pairs.
Args:
hive (str): The hive to connect to
key (str): The key to check
use_32bit_registry (bool): Look in the 32bit portion of the registry
Returns:
bool: True if exists, ot... |
Enumerates the subkeys in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
- HKEY_CLASSES_ROOT or HKCR
... |
r'''
Enumerates the values in a registry key or hive.
Args:
hive (str):
The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
- HKEY_CLASSES_ROOT or HKC... |
r'''
Reads a registry value entry or the default value for a key. To read the
default value, don't pass ``vname``
Args:
hive (str): The name of the hive. Can be one of the following:
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
... |
Sets a value in the registry. If ``vname`` is passed, it will be the value
for that value name, otherwise it will be the default value for the
specified key
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
... |
r'''
.. versionadded:: 2015.5.4
Delete a registry key to include all subkeys and value/data pairs.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER ... |
r'''
Delete a registry value entry or the default value for a key.
Args:
hive (str):
The name of the hive. Can be one of the following
- HKEY_LOCAL_MACHINE or HKLM
- HKEY_CURRENT_USER or HKCU
- HKEY_USER or HKU
- HKEY_CLASSES... |
Import registry settings from a Windows ``REG`` file by invoking ``REG.EXE``.
.. versionadded:: 2018.3.0
Args:
source (str):
The full path of the ``REG`` file. This can be either a local file
path or a URL type supported by salt (e.g. ``salt://salt_master_path``)
use_... |
Execute a command and read the output as YAML
def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
use_grain=False,
minion_ids=None,
tag_match_key=None,
tag_match_value='asis',
tag_list_key=None,
tag_list_sep... |
Return an existing set of certificates
def ext_pillar(minion_id, pillar, conf):
'''
Return an existing set of certificates
'''
cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR)
ret = {}
dns_names = cache.fetch('venafi/minions', minion_id)
for dns_name in dns_names:
data = cach... |
Return the status for a service via s6, return pid if running
CLI Example:
.. code-block:: bash
salt '*' s6.status <service name>
def status(name, sig=None):
'''
Return the status for a service via s6, return pid if running
CLI Example:
.. code-block:: bash
salt '*' s6.sta... |
Return a list of all available services
CLI Example:
.. code-block:: bash
salt '*' s6.get_all
def get_all():
'''
Return a list of all available services
CLI Example:
.. code-block:: bash
salt '*' s6.get_all
'''
if not SERVICE_DIR:
raise CommandExecutionErro... |
Add a host object for the given mac.
CLI Example:
.. code-block:: bash
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1
Add ddns-hostname and a fixed-ip statements:
.. code-block:: bash
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1 ip=10.1.1.1 ddns=true
... |
Delete the host with the given mac or name.
CLI Examples:
.. code-block:: bash
salt dhcp-server omapi.delete_host name=host1
salt dhcp-server omapi.delete_host mac=ab:ab:ab:ab:ab:ab
def delete_host(mac=None, name=None):
'''
Delete the host with the given mac or name.
CLI Example... |
Return the auth object
def _auth():
'''
Return the auth object
'''
if 'auth' not in __context__:
try:
__context__['auth'] = salt.crypt.SAuth(__opts__)
except SaltClientError:
log.error('Could not authenticate with master.'
'Mine data will no... |
Execute the configured functions and send the data back up to the master.
The functions to be executed are merged from the master config, pillar and
minion config under the option `mine_functions`:
.. code-block:: yaml
mine_functions:
network.ip_addrs:
- eth0
disk.u... |
Send a specific function to the mine.
CLI Example:
.. code-block:: bash
salt '*' mine.send network.ip_addrs eth0
salt '*' mine.send eth0_ip_addrs mine_function=network.ip_addrs eth0
def send(func, *args, **kwargs):
'''
Send a specific function to the mine.
CLI Example:
.. c... |
Get data from the mine based on the target, function and tgt_type
Targets can be matched based on any standard matching system that can be
matched on the master via these keywords:
- glob
- pcre
- grain
- grain_pcre
- compound
- pillar
- pillar_pcre
Note that all pillar matche... |
Remove specific function contents of minion. Returns True on success.
CLI Example:
.. code-block:: bash
salt '*' mine.delete 'network.interfaces'
def delete(fun):
'''
Remove specific function contents of minion. Returns True on success.
CLI Example:
.. code-block:: bash
sa... |
.. versionchanged:: 2017.7.8,2018.3.3
When :conf_minion:`docker.update_mine` is set to ``False`` for a given
minion, no mine data will be populated for that minion, and thus none
will be returned for it.
.. versionchanged:: 2019.2.0
:conf_minion:`docker.update_mine` now defaults to `... |
List valid entries in mine configuration.
CLI Example:
.. code-block:: bash
salt '*' mine.valid
def valid():
'''
List valid entries in mine configuration.
CLI Example:
.. code-block:: bash
salt '*' mine.valid
'''
m_data = __salt__['config.merge']('mine_functions', ... |
Return data to a Pg server
def returner(ret):
'''
Return data to a Pg server
'''
try:
with _get_serv(ret, commit=True) as cur:
sql = '''INSERT INTO salt_returns
(fun, jid, return, id, success, full_ret, alter_time)
VALUES (%s, %s, %s, %s, %s, ... |
Return event to Pg server
Requires that configuration be enabled via 'event_return'
option in master config.
def event_return(events):
'''
Return event to Pg server
Requires that configuration be enabled via 'event_return'
option in master config.
'''
with _get_serv(events, commit=Tru... |
Save the load to the specified jid id
def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
'''
with _get_serv(commit=True) as cur:
try:
cur.execute(PG_SAVE_LOAD_SQL,
{'jid': jid, 'load': psycopg2.extras.Json(load)})
except... |
Return the load data that marks a specified jid
def get_load(jid):
'''
Return the load data that marks a specified jid
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT load FROM jids WHERE jid = %s;'''
cur.execute(sql, (jid,))
data = cur.fetchone()
if d... |
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
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT id, full_ret FROM salt_returns
WHERE jid = %s'''... |
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
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT s.id,s.jid, s.full_ret
FROM salt_returns s
JOIN ( SELECT M... |
Purge records from the returner tables.
:param job_age_in_seconds: Purge jobs older than this
:return:
def _purge_jobs(timestamp):
'''
Purge records from the returner tables.
:param job_age_in_seconds: Purge jobs older than this
:return:
'''
with _get_serv() as cursor:
try:
... |
Copy rows to a set of backup tables, then purge rows.
:param timestamp: Archive rows older than this timestamp
:return:
def _archive_jobs(timestamp):
'''
Copy rows to a set of backup tables, then purge rows.
:param timestamp: Archive rows older than this timestamp
:return:
'''
source_ta... |
Called in the master's event loop every loop_interval. Archives and/or
deletes the events and job details from the database.
:return:
def clean_old_jobs():
'''
Called in the master's event loop every loop_interval. Archives and/or
deletes the events and job details from the database.
:return:... |
Return information about the CPU.
Returns
dict: A dictionary containing information about the CPU stats
CLI Example:
.. code-block:: bash
salt * status.cpustats
def cpustats():
'''
Return information about the CPU.
Returns
dict: A dictionary containing information a... |
Return information about physical and virtual memory on the system
Returns:
dict: A dictionary of information about memory on the system
CLI Example:
.. code-block:: bash
salt * status.meminfo
def meminfo():
'''
Return information about physical and virtual memory on the system
... |
Return information about the virtual memory on the machine
Returns:
dict: A dictionary of virtual memory stats
CLI Example:
.. code-block:: bash
salt * status.vmstats
def vmstats():
'''
Return information about the virtual memory on the machine
Returns:
dict: A dict... |
.. versionadded:: 2015.8.0
Return the disk usage for this minion
human_readable : False
If ``True``, usage will be in KB/MB/GB etc.
CLI Example:
.. code-block:: bash
salt '*' status.diskusage path=c:/salt
def diskusage(human_readable=False, path=None):
'''
.. versionadded::... |
Return the process data
count : False
If ``True``, this function will simply return the number of processes.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' status.procs
salt '*' status.procs count
def procs(count=False):
'''
Return the pro... |
.. versionadded:: 2015.8.0
Returns the amount of memory that salt is using
human_readable : False
return the value in a nicely formatted number
CLI Example:
.. code-block:: bash
salt '*' status.saltmem
salt '*' status.saltmem human_readable=True
def saltmem(human_readable=F... |
.. versionadded:: 2015.8.0
Return the system uptime for the machine
Args:
human_readable (bool):
Return uptime in human readable format if ``True``, otherwise
return seconds. Default is ``False``
.. note::
Human readable format is ``days, hours:min... |
Return process information
def _get_process_info(proc):
'''
Return process information
'''
cmd = salt.utils.stringutils.to_unicode(proc.CommandLine or '')
name = salt.utils.stringutils.to_unicode(proc.Name)
info = dict(
cmd=cmd,
name=name,
**_get_process_owner(proc)
... |
.. versionadded:: 2015.5.0
Fire an event if the minion gets disconnected from its master. This
function is meant to be run via a scheduled job from the minion. If
master_ip is an FQDN/Hostname, is must be resolvable to a valid IPv4
address.
CLI Example:
.. code-block:: bash
salt '*' ... |
Verify the config file is present
def _check_config_exists(config_file=None):
'''
Verify the config file is present
'''
if config_file is None:
config_file = _config_file()
if not os.path.isfile(config_file):
return False
return True |
Return True if jail exists False if not
CLI Example:
.. code-block:: bash
salt '*' poudriere.is_jail <jail name>
def is_jail(name):
'''
Return True if jail exists False if not
CLI Example:
.. code-block:: bash
salt '*' poudriere.is_jail <jail name>
'''
jails = list... |
Make jail ``jname`` pkgng aware
CLI Example:
.. code-block:: bash
salt '*' poudriere.make_pkgng_aware <jail name>
def make_pkgng_aware(jname):
'''
Make jail ``jname`` pkgng aware
CLI Example:
.. code-block:: bash
salt '*' poudriere.make_pkgng_aware <jail name>
'''
... |
Returns a dict of poudriere main configuration definitions
CLI Example:
.. code-block:: bash
salt '*' poudriere.parse_config
def parse_config(config_file=None):
'''
Returns a dict of poudriere main configuration definitions
CLI Example:
.. code-block:: bash
salt '*' poudri... |
Creates a new poudriere jail if one does not exist
*NOTE* creating a new jail will take some time the master is not hanging
CLI Example:
.. code-block:: bash
salt '*' poudriere.create_jail 90amd64 amd64
def create_jail(name, arch, version="9.0-RELEASE"):
'''
Creates a new poudriere jail... |
Run freebsd-update on `name` poudriere jail
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_jail freebsd:10:x86:64
def update_jail(name):
'''
Run freebsd-update on `name` poudriere jail
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_jail freebsd:10... |
Deletes poudriere jail with `name`
CLI Example:
.. code-block:: bash
salt '*' poudriere.delete_jail 90amd64
def delete_jail(name):
'''
Deletes poudriere jail with `name`
CLI Example:
.. code-block:: bash
salt '*' poudriere.delete_jail 90amd64
'''
if is_jail(name):
... |
Updates the ports tree, either the default or the `ports_tree` specified
CLI Example:
.. code-block:: bash
salt '*' poudriere.update_ports_tree staging
def update_ports_tree(ports_tree):
'''
Updates the ports tree, either the default or the `ports_tree` specified
CLI Example:
.. co... |
Run bulk build on poudriere server.
Return number of pkg builds, failures, and errors, on error dump to CLI
CLI Example:
.. code-block:: bash
salt -N buildbox_group poudriere.bulk_build 90amd64 /root/pkg_list
def bulk_build(jail, pkg_file, keep=False):
'''
Run bulk build on poudriere se... |
NILRT systems determine whether to reboot after various package operations
including but not limited to kernel module installs/removals by checking
specific file md5sums & timestamps. These files are touched/modified by
the post-install/post-remove functions of their respective packages.
The opkg modul... |
Return restartcheck result and append errors (if any) to ``errors``
def _get_restartcheck_result(errors):
'''
Return restartcheck result and append errors (if any) to ``errors``
'''
rs_result = __salt__['restartcheck.restartcheck'](verbose=False)
if isinstance(rs_result, dict) and 'comment' in rs_r... |
Check restartcheck output to see if system/service restarts were requested
and take appropriate action.
def _process_restartcheck_result(rs_result, **kwargs):
'''
Check restartcheck output to see if system/service restarts were requested
and take appropriate action.
'''
if 'No packages seem to ... |
Updates the opkg database to latest packages based upon repositories
Returns a dict, with the keys being package databases and the values being
the result of the update attempt. Values can be one of the following:
- ``True``: Database updated successfully
- ``False``: Problem updating database
fa... |
Builds a list of install commands to be executed in sequence in order to process
each of the to_install, to_downgrade, and to_reinstall lists.
def _build_install_command_list(cmd_prefix, to_install, to_downgrade, to_reinstall):
'''
Builds a list of install commands to be executed in sequence in order to pr... |
Parses the output of "opkg install" to determine what packages would have been
installed by an operation run with the --noaction flag.
We are looking for lines like:
Installing <package> (<version>) on <target>
or
Upgrading <package> from <oldVersion> to <version> on root
def _parse_report... |
Executes a command for the install operation.
If the command fails, its error output will be appended to the errors list.
If the command succeeds and parse_output is true, updated packages will be appended
to the parsed_packages dictionary.
def _execute_install_command(cmd, parse_output, errors, parsed_pac... |
Install the passed package, add refresh=True to update the opkg database.
name
The name of the package to be installed. Note that this parameter is
ignored if either "pkgs" or "sources" is passed. Additionally, please
note that this option can only be used to install packages from a
... |
Parses the output of "opkg remove" to determine what packages would have been
removed by an operation run with the --noaction flag.
We are looking for lines like
Removing <package> (<version>) from <Target>...
def _parse_reported_packages_from_remove_output(output):
'''
Parses the output of "o... |
Remove packages using ``opkg remove``.
name
The name of the package to be deleted.
Multiple Package Options:
pkgs
A list of packages to delete. Must be passed as a python list. The
``name`` parameter will be ignored if this option is passed.
remove_dependencies
Remov... |
Upgrades all packages via ``opkg upgrade``
Returns a dictionary containing the changes:
.. code-block:: python
{'<package>': {'old': '<old-version>',
'new': '<new-version>'}}
CLI Example:
.. code-block:: bash
salt '*' pkg.upgrade
def upgrade(refresh=True,... |
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
CLI Example:
.. code-block:: bash
salt '*' pkg.hold <package name>
pkgs
A list of packages to hold. Must be passed as a python list.
CLI Example:
... |
View package state from the opkg database
Return the state of pkg
def _get_state(pkg):
'''
View package state from the opkg database
Return the state of pkg
'''
cmd = ['opkg', 'status']
cmd.append(pkg)
out = __salt__['cmd.run'](cmd, python_shell=False)
state_flag = ''
for line... |
Change package state on the opkg database
The state can be any of:
- hold
- noprune
- user
- ok
- installed
- unpacked
This command is commonly used to mark a specific package to be held from
being upgraded, that is, to be kept at a certain version.
Returns a dict conta... |
List all available package upgrades.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgrades
def list_upgrades(refresh=True, **kwargs): # pylint: disable=unused-argument
'''
List all available package upgrades.
CLI Example:
.. code-block:: bash
salt '*' pkg.list_upgr... |
Helper function for _process_info_installed_output()
Converts an opkg attribute name to a standard attribute
name which is used across 'pkg' modules.
def _convert_to_standard_attr(attr):
'''
Helper function for _process_info_installed_output()
Converts an opkg attribute name to a standard attribu... |
Helper function for info_installed()
Processes stdout output from a single invocation of
'opkg status'.
def _process_info_installed_output(out, filter_attrs):
'''
Helper function for info_installed()
Processes stdout output from a single invocation of
'opkg status'.
'''
ret = {}
n... |
Return the information of the named package(s), installed on the system.
.. versionadded:: 2017.7.0
:param names:
Names of the packages to get information about. If none are specified,
will return information for all installed packages.
:param attr:
Comma-separated package attribu... |
Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
making the comparison.
ignore_epoch : False
Set to ``True`` to ignore the epoch when comparing versions
.. versionadded:: 2016.3.4
CLI Examp... |
Set the option to repo
def _set_repo_option(repo, option):
'''
Set the option to repo
'''
if not option:
return
opt = option.split('=')
if len(opt) != 2:
return
if opt[0] == 'trusted':
repo['trusted'] = opt[1] == 'yes'
else:
repo[opt[0]] = opt[1] |
Set the options to the repo.
def _set_repo_options(repo, options):
'''
Set the options to the repo.
'''
delimiters = "[", "]"
pattern = '|'.join(map(re.escape, delimiters))
for option in options:
splitted = re.split(pattern, option)
for opt in splitted:
_set_repo_opt... |
Create repo
def _create_repo(line, filename):
'''
Create repo
'''
repo = {}
if line.startswith('#'):
repo['enabled'] = False
line = line[1:]
else:
repo['enabled'] = True
cols = salt.utils.args.shlex_split(line.strip())
repo['compressed'] = not cols[0] in 'src'
... |
Read repos from configuration file
def _read_repos(conf_file, repos, filename, regex):
'''
Read repos from configuration file
'''
for line in conf_file:
line = salt.utils.stringutils.to_unicode(line)
if not regex.search(line):
continue
repo = _create_repo(line, filen... |
Lists all repos on ``/etc/opkg/*.conf``
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
def list_repos(**kwargs): # pylint: disable=unused-argument
'''
Lists all repos on ``/etc/opkg/*.conf``
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
re... |
Display a repo from the ``/etc/opkg/*.conf``
CLI Examples:
.. code-block:: bash
salt '*' pkg.get_repo repo
def get_repo(repo, **kwargs): # pylint: disable=unused-argument
'''
Display a repo from the ``/etc/opkg/*.conf``
CLI Examples:
.. code-block:: bash
salt '*' pkg.get_... |
Remove a repo from filepath
def _del_repo_from_file(repo, filepath):
'''
Remove a repo from filepath
'''
with salt.utils.files.fopen(filepath) as fhandle:
output = []
regex = re.compile(REPO_REGEXP)
for line in fhandle:
line = salt.utils.stringutils.to_unicode(line)
... |
Set trusted option to repo if needed
def _set_trusted_option_if_needed(repostr, trusted):
'''
Set trusted option to repo if needed
'''
if trusted is True:
repostr += ' [trusted=yes]'
elif trusted is False:
repostr += ' [trusted=no]'
return repostr |
Add a new repo entry
def _add_new_repo(repo, properties):
'''
Add a new repo entry
'''
repostr = '# ' if not properties.get('enabled') else ''
repostr += 'src/gz ' if properties.get('compressed') else 'src '
if ' ' in repo:
repostr += '"' + repo + '" '
else:
repostr += repo ... |
Replace a repo entry in filepath with repostr
def _mod_repo_in_file(repo, repostr, filepath):
'''
Replace a repo entry in filepath with repostr
'''
with salt.utils.files.fopen(filepath) as fhandle:
output = []
for line in fhandle:
cols = salt.utils.args.shlex_split(
... |
Delete a repo from ``/etc/opkg/*.conf``
If the file does not contain any other repo configuration, the file itself
will be deleted.
CLI Examples:
.. code-block:: bash
salt '*' pkg.del_repo repo
def del_repo(repo, **kwargs): # pylint: disable=unused-argument
'''
Delete a repo from `... |
Modify one or more values for a repo. If the repo does not exist, it will
be created, so long as uri is defined.
The following options are available to modify a repo definition:
repo
alias by which opkg refers to the repo.
uri
the URI to the repo.
compressed
defines (True ... |
List the files that belong to a package. Not specifying any packages will
return a list of _every_ file on the system's package database (not
generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*' pkg.file_list httpd postfix
salt '*' p... |
List the files that belong to a package, grouped by package. Not
specifying any packages will return a list of _every_ file on the system's
package database (not generally recommended).
CLI Examples:
.. code-block:: bash
salt '*' pkg.file_list httpd
salt '*' pkg.file_list httpd postfi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.