Search is not available for this dataset
text stringlengths 75 104k |
|---|
def _get_conn(key=None,
keyid=None,
profile=None,
region=None,
**kwargs):
'''
Create a boto3 client connection to EFS
'''
client = None
if profile:
if isinstance(profile, six.string_types):
if profile in __pillar__:
... |
def create_file_system(name,
performance_mode='generalPurpose',
keyid=None,
key=None,
profile=None,
region=None,
creation_token=None,
**kwargs):
'''
Cr... |
def create_mount_target(filesystemid,
subnetid,
ipaddress=None,
securitygroups=None,
keyid=None,
key=None,
profile=None,
region=None,
... |
def create_tags(filesystemid,
tags,
keyid=None,
key=None,
profile=None,
region=None,
**kwargs):
'''
Creates or overwrites tags associated with a file system.
Each tag is a key-value pair. If a tag key specified i... |
def delete_file_system(filesystemid,
keyid=None,
key=None,
profile=None,
region=None,
**kwargs):
'''
Deletes a file system, permanently severing access to its contents.
Upon return, the file sy... |
def delete_mount_target(mounttargetid,
keyid=None,
key=None,
profile=None,
region=None,
**kwargs):
'''
Deletes the specified mount target.
This operation forcibly breaks any mounts of the file... |
def delete_tags(filesystemid,
tags,
keyid=None,
key=None,
profile=None,
region=None,
**kwargs):
'''
Deletes the specified tags from a file system.
filesystemid
(string) - ID of the file system for whose ... |
def get_file_systems(filesystemid=None,
keyid=None,
key=None,
profile=None,
region=None,
creation_token=None,
**kwargs):
'''
Get all EFS properties or a specific instance property
if... |
def get_mount_targets(filesystemid=None,
mounttargetid=None,
keyid=None,
key=None,
profile=None,
region=None,
**kwargs):
'''
Get all the EFS mount point properties for a specific f... |
def get_tags(filesystemid,
keyid=None,
key=None,
profile=None,
region=None,
**kwargs):
'''
Return the tags associated with an EFS instance.
filesystemid
(string) - ID of the file system whose tags to list
returns
(list) -... |
def set_security_groups(mounttargetid,
securitygroup,
keyid=None,
key=None,
profile=None,
region=None,
**kwargs):
'''
Modifies the set of security groups in effect for ... |
def installed(name, source):
'''
Ensure an update is installed on the minion
Args:
name(str):
Name of the Windows KB ("KB123456")
source (str):
Source of .msu file corresponding to the KB
Example:
.. code-block:: yaml
KB123456:
wusa.ins... |
def uninstalled(name):
'''
Ensure an update is uninstalled from the minion
Args:
name(str):
Name of the Windows KB ("KB123456")
Example:
.. code-block:: yaml
KB123456:
wusa.uninstalled
'''
ret = {'name': name,
'changes': {},
'r... |
def send(kwargs, opts):
'''
Send an email with the data
'''
opt_keys = (
'smtp.to',
'smtp.from',
'smtp.host',
'smtp.port',
'smtp.tls',
'smtp.username',
'smtp.password',
'smtp.subject',
'smtp.gpgowner',
'smtp.content',
)
... |
def list_cidr_ips(cidr):
'''
Get a list of IP addresses from a CIDR.
CLI example::
salt myminion netaddress.list_cidr_ips 192.168.0.0/20
'''
ips = netaddr.IPNetwork(cidr)
return [six.text_type(ip) for ip in list(ips)] |
def list_cidr_ips_ipv6(cidr):
'''
Get a list of IPv6 addresses from a CIDR.
CLI example::
salt myminion netaddress.list_cidr_ips_ipv6 192.168.0.0/20
'''
ips = netaddr.IPNetwork(cidr)
return [six.text_type(ip.ipv6()) for ip in list(ips)] |
def cidr_netmask(cidr):
'''
Get the netmask address associated with a CIDR address.
CLI example::
salt myminion netaddress.cidr_netmask 192.168.0.0/20
'''
ips = netaddr.IPNetwork(cidr)
return six.text_type(ips.netmask) |
def cidr_broadcast(cidr):
'''
Get the broadcast address associated with a CIDR address.
CLI example::
salt myminion netaddress.cidr_netmask 192.168.0.0/20
'''
ips = netaddr.IPNetwork(cidr)
return six.text_type(ips.broadcast) |
def restart_service(service_name, minimum_running_time=None):
'''
Restart OpenStack service immediately, or only if it's running longer than
specified value
CLI Example:
.. code-block:: bash
salt '*' openstack_mng.restart_service neutron
salt '*' openstack_mng.restart_service neut... |
def _get_options(ret=None):
'''
Returns options used for the MySQL connection.
'''
defaults = {'host': 'salt',
'user': 'salt',
'pass': 'salt',
'db': 'salt',
'port': 3306,
'ssl_ca': None,
'ssl_cert': None,
... |
def _get_serv(ret=None, commit=False):
'''
Return a mysql cursor
'''
_options = _get_options(ret)
connect = True
if __context__ and 'mysql_returner_conn' in __context__:
try:
log.debug('Trying to reuse MySQL connection pool')
conn = __context__['mysql_returner_co... |
def returner(ret):
'''
Return data to a mysql server
'''
# if a minion is returning a standalone job, get a jobid
if ret['jid'] == 'req':
ret['jid'] = prep_jid(nocache=ret.get('nocache', False))
save_load(ret['jid'], ret)
try:
with _get_serv(ret, commit=True) as cur:
... |
def event_return(events):
'''
Return event to mysql server
Requires that configuration be enabled via 'event_return'
option in master config.
'''
with _get_serv(events, commit=True) as cur:
for event in events:
tag = event.get('tag', '')
data = event.get('data', ... |
def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
'''
with _get_serv(commit=True) as cur:
sql = '''INSERT INTO `jids` (`jid`, `load`) VALUES (%s, %s)'''
try:
cur.execute(sql, (jid, salt.utils.json.dumps(load)))
except MySQLdb.Integrit... |
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 data:
return salt.utils.json.loa... |
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'''
cur.execute(sql, (jid,))
data = cur.fetchall()
... |
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 MAX(`jid`) as jid
from `salt_returns` ... |
def get_jids_filter(count, filter_find_job=True):
'''
Return a list of all job ids
:param int count: show not more than the count of most recent jobs
:param bool filter_find_jobs: filter out 'saltutil.find_job' jobs
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT * FRO... |
def get_minions():
'''
Return a list of minions
'''
with _get_serv(ret=None, commit=True) as cur:
sql = '''SELECT DISTINCT id
FROM `salt_returns`'''
cur.execute(sql)
data = cur.fetchall()
ret = []
for minion in data:
ret.append(minion... |
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 cur:
try:
sql = 'delete from `jids` where jid in (select distinct jid from salt_returns where alter_time < %s)'
... |
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_tables = ['jids',
'salt_returns',
'salt_events']
with _get_serv() as cur:
ta... |
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:
'''
if __opts__.get('keep_jobs', False) and int(__opts__.get('keep_jobs', 0)) > 0:
try:
with _get_serv() as cur:
... |
def _verify_options(options):
'''
Verify options and log warnings
Returns True if all options can be verified,
otherwise False
'''
# sanity check all vals used for bitwise operations later
bitwise_args = [('level', options['level']),
('facility', options['facility'])
... |
def returner(ret):
'''
Return data to the local syslog
'''
_options = _get_options(ret)
if not _verify_options(_options):
return
# Get values from syslog module
level = getattr(syslog, _options['level'])
facility = getattr(syslog, _options['facility'])
# parse for syslog ... |
def error(self, msg):
'''
error(msg : string)
Print a usage message incorporating 'msg' to stderr and exit.
This keeps option parsing exit status uniform for all parsing errors.
'''
self.print_usage(sys.stderr)
self.exit(salt.defaults.exitcodes.EX_USAGE, '{0}: er... |
def check_running(self):
'''
Check if a pid file exists and if it is associated with
a running process.
'''
if self.check_pidfile():
pid = self.get_pidfile()
if not salt.utils.platform.is_windows():
if self.check_pidfile() and self.is_daem... |
def find_existing_configs(self, default):
'''
Find configuration files on the system.
:return:
'''
configs = []
for cfg in [default, self._config_filename_, 'minion', 'proxy', 'cloud', 'spm']:
if not cfg:
continue
config_path = self... |
def setup_config(self, cfg=None):
'''
Open suitable config file.
:return:
'''
_opts, _args = optparse.OptionParser.parse_args(self)
configs = self.find_existing_configs(_opts.support_unit)
if configs and cfg not in configs:
cfg = configs[0]
re... |
def coalesce(name, **kwargs):
'''
Manage coalescing settings of network device
name
Interface name to apply coalescing settings
.. code-block:: yaml
eth0:
ethtool.coalesce:
- name: eth0
- adaptive_rx: on
- adaptive_tx: on
- rx_... |
def datacenter_configured(name):
'''
Makes sure a datacenter exists.
If the state is run by an ``esxdatacenter`` minion, the name of the
datacenter is retrieved from the proxy details, otherwise the datacenter
has the same name as the state.
Supported proxies: esxdatacenter
name:
... |
def _container_path(model,
key=None,
container=None,
delim=DEFAULT_TARGET_DELIM):
'''
Generate all the possible paths within an OpenConfig-like object.
This function returns a generator.
'''
if not key:
key = ''
if not container... |
def setval(key, val, dict_=None, delim=DEFAULT_TARGET_DELIM):
'''
Set a value under the dictionary hierarchy identified
under the key. The target 'foo/bar/baz' returns the
dictionary hierarchy {'foo': {'bar': {'baz': {}}}}.
.. note::
Currently this doesn't work with integers, i.e.
... |
def traverse(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM):
'''
Traverse a dict or list using a colon-delimited (or otherwise delimited,
using the ``delimiter`` param) target string. The target ``foo:bar:0`` will
return ``data['foo']['bar'][0]`` if this value exists, and will otherwise
re... |
def dictupdate(dest, upd, recursive_update=True, merge_lists=False):
'''
Recursive version of the default dict.update
Merges upd recursively into dest
If recursive_update=False, will use the classic dict.update, or fall back
on a manual merge (helpful for non-dict types like ``FunctionWrapper``).
... |
def defaults(model,
defaults_,
delim='//',
flipped_merge=False):
'''
Apply the defaults to a Python dictionary having the structure as described
in the OpenConfig standards.
model
The OpenConfig model to apply the defaults to.
defaults
The dic... |
def render_field(dictionary,
field,
prepend=None,
append=None,
quotes=False,
**opts):
'''
Render a field found under the ``field`` level of the hierarchy in the
``dictionary`` object.
This is useful to render a field in... |
def render_fields(dictionary,
*fields,
**opts):
'''
This function works similarly to
:mod:`render_field <salt.modules.napalm_formula.render_field>` but for a
list of fields from the same dictionary, rendering, indenting and
distributing them on separate lines.
... |
def installed(name,
features=None,
recurse=False,
restart=False,
source=None,
exclude=None):
'''
Install the windows feature. To install a single feature, use the ``name``
parameter. To install multiple features, use the ``features`` para... |
def removed(name, features=None, remove_payload=False, restart=False):
'''
Remove the windows feature To remove a single feature, use the ``name``
parameter. To remove multiple features, use the ``features`` parameter.
Args:
name (str):
Short name of the feature (the right column in... |
def _check_cors_origin(origin, allowed_origins):
'''
Check if an origin match cors allowed origins
'''
if isinstance(allowed_origins, list):
if origin in allowed_origins:
return origin
elif allowed_origins == '*':
return allowed_origins
elif allowed_origins == origin:... |
def clean_by_request(self, request):
'''
Remove all futures that were waiting for request `request` since it is done waiting
'''
if request not in self.request_map:
return
for tag, matcher, future in self.request_map[request]:
# timeout the future
... |
def get_event(self,
request,
tag='',
matcher=prefix_matcher.__func__,
callback=None,
timeout=None
):
'''
Get an event (asynchronous of course) return a future that will get it later
'''
... |
def _timeout_future(self, tag, matcher, future):
'''
Timeout a specific future
'''
if (tag, matcher) not in self.tag_map:
return
if not future.done():
future.set_exception(TimeoutException())
self.tag_map[(tag, matcher)].remove(future)
... |
def _handle_event_socket_recv(self, raw):
'''
Callback for events on the event sub socket
'''
mtag, data = self.event.unpack(raw, self.event.serial)
# see if we have any futures that need this info:
for (tag, matcher), futures in six.iteritems(self.tag_map):
... |
def _verify_client(self, low):
'''
Verify that the client is in fact one we have
'''
if 'client' not in low or low.get('client') not in self.saltclients:
self.set_status(400)
self.write("400 Invalid Client: Client not found in salt clients")
self.finis... |
def initialize(self):
'''
Initialize the handler before requests are called
'''
if not hasattr(self.application, 'event_listener'):
log.debug('init a listener')
self.application.event_listener = EventListener(
self.application.mod_opts,
... |
def token(self):
'''
The token used for the request
'''
# find the token (cookie or headers)
if AUTH_TOKEN_HEADER in self.request.headers:
return self.request.headers[AUTH_TOKEN_HEADER]
else:
return self.get_cookie(AUTH_COOKIE_NAME) |
def _verify_auth(self):
'''
Boolean whether the request is auth'd
'''
return self.token and bool(self.application.auth.get_tok(self.token)) |
def prepare(self):
'''
Run before get/posts etc. Pre-flight checks:
- verify that we can speak back to them (compatible accept header)
'''
# Find an acceptable content-type
accept_header = self.request.headers.get('Accept', '*/*')
# Ignore any parameter, inclu... |
def serialize(self, data):
'''
Serlialize the output based on the Accept header
'''
self.set_header('Content-Type', self.content_type)
return self.dumper(data) |
def _form_loader(self, _):
'''
function to get the data from the urlencoded forms
ignore the data passed in and just get the args from wherever they are
'''
data = {}
for key in self.request.arguments:
val = self.get_arguments(key)
if len(val) == 1... |
def deserialize(self, data):
'''
Deserialize the data based on request content type headers
'''
ct_in_map = {
'application/x-www-form-urlencoded': self._form_loader,
'application/json': salt.utils.json.loads,
'application/x-yaml': salt.utils.yaml.safe_... |
def _get_lowstate(self):
'''
Format the incoming data into a lowstate object
'''
if not self.request.body:
return
data = self.deserialize(self.request.body)
self.request_payload = copy(data)
if data and 'arg' in data and not isinstance(data['arg'], li... |
def set_default_headers(self):
'''
Set default CORS headers
'''
mod_opts = self.application.mod_opts
if mod_opts.get('cors_origin'):
origin = self.request.headers.get('Origin')
allowed_origin = _check_cors_origin(origin, mod_opts['cors_origin'])
... |
def options(self, *args, **kwargs):
'''
Return CORS headers for preflight requests
'''
# Allow X-Auth-Token in requests
request_headers = self.request.headers.get('Access-Control-Request-Headers')
allowed_headers = request_headers.split(',')
# Filter allowed head... |
def get(self):
'''
All logins are done over post, this is a parked endpoint
.. http:get:: /login
:status 401: |401|
:status 406: |406|
**Example request:**
.. code-block:: bash
curl -i localhost:8000/login
.. code-block:: text
... |
def post(self):
'''
:ref:`Authenticate <rest_tornado-auth>` against Salt's eauth system
.. http:post:: /login
:reqheader X-Auth-Token: |req_token|
:reqheader Accept: |req_accept|
:reqheader Content-Type: |req_ct|
:form eauth: the eauth backend c... |
def get(self):
'''
An endpoint to determine salt-api capabilities
.. http:get:: /
:reqheader Accept: |req_accept|
:status 200: |200|
:status 401: |401|
:status 406: |406|
**Example request:**
.. code-block:: bash
c... |
def disbatch(self):
'''
Disbatch all lowstates to the appropriate clients
'''
ret = []
# check clients before going, we want to throw 400 if one is bad
for low in self.lowstate:
if not self._verify_client(low):
return
# Make sure ... |
def _disbatch_local(self, chunk):
'''
Dispatch local client commands
'''
# Generate jid and find all minions before triggering a job to subscribe all returns from minions
full_return = chunk.pop('full_return', False)
chunk['jid'] = salt.utils.jid.gen_jid(self.application.... |
def job_not_running(self, jid, tgt, tgt_type, minions, is_finished):
'''
Return a future which will complete once jid (passed in) is no longer
running on tgt
'''
ping_pub_data = yield self.saltclients['local'](tgt,
'saltutil... |
def _disbatch_local_async(self, chunk):
'''
Disbatch local client_async commands
'''
f_call = self._format_call_run_job_async(chunk)
# fire a job off
pub_data = yield self.saltclients['local_async'](*f_call.get('args', ()), **f_call.get('kwargs', {}))
raise torna... |
def _disbatch_runner(self, chunk):
'''
Disbatch runner client commands
'''
full_return = chunk.pop('full_return', False)
pub_data = self.saltclients['runner'](chunk)
tag = pub_data['tag'] + '/ret'
try:
event = yield self.application.event_listener.get_... |
def _disbatch_runner_async(self, chunk):
'''
Disbatch runner client_async commands
'''
pub_data = self.saltclients['runner'](chunk)
raise tornado.gen.Return(pub_data) |
def get(self, mid=None): # pylint: disable=W0221
'''
A convenience URL for getting lists of minions or getting minion
details
.. http:get:: /minions/(mid)
:reqheader X-Auth-Token: |req_token|
:reqheader Accept: |req_accept|
:status 200: |200|
... |
def post(self):
'''
Start an execution command and immediately return the job id
.. http:post:: /minions
:reqheader X-Auth-Token: |req_token|
:reqheader Accept: |req_accept|
:reqheader Content-Type: |req_ct|
:resheader Content-Type: |res_ct|
... |
def get(self, jid=None): # pylint: disable=W0221
'''
A convenience URL for getting lists of previously run jobs or getting
the return from a single job
.. http:get:: /jobs/(jid)
List jobs or show a single job from the job cache.
:status 200: |200|
... |
def get(self):
r'''
An HTTP stream of the Salt master event bus
This stream is formatted per the Server Sent Events (SSE) spec. Each
event is formatted as JSON.
.. http:get:: /events
:status 200: |200|
:status 401: |401|
:status 406: |406|
... |
def post(self, tag_suffix=None): # pylint: disable=W0221
'''
Fire an event in Salt with a custom event tag and data
.. http:post:: /hook
:status 200: |200|
:status 401: |401|
:status 406: |406|
:status 413: request body is too large
**E... |
def beacon(config):
'''
Called several times each second
https://docs.saltstack.com/en/latest/topics/beacons/#the-beacon-function
.. code-block:: yaml
beacons:
proxy_example:
- endpoint: beacon
'''
# Important!!!
# Although this toy example makes an HTTP call
... |
def absent(name):
'''
Ensure user account is absent
name : string
username
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
# remove if needed
if name in __salt__['pdbedit.list'](False):
res = __salt__['pdbedit.delete']... |
def managed(name, **kwargs):
'''
Manage 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
scrip... |
def _write_proxy_conf(proxyfile):
'''
write to file
'''
msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \
.format(proxyfile)
log.trace('Salt Proxy Module: write proxy conf')
if proxyfile:
log.debug('Writing proxy conf file')
with salt.utils.files.fo... |
def _proxy_conf_file(proxyfile, test):
'''
Check if proxy conf exists and update
'''
changes_old = []
changes_new = []
success = True
if not os.path.exists(proxyfile):
try:
if not test:
changes_new.append(_write_proxy_conf(proxyfile))
msg =... |
def _is_proxy_running(proxyname):
'''
Check if proxy for this name is running
'''
cmd = ('ps ax | grep "salt-proxy --proxyid={0}" | grep -v grep'
.format(salt.ext.six.moves.shlex_quote(proxyname)))
cmdout = __salt__['cmd.run_all'](
cmd,
timeout=5,
python_shell=True... |
def _proxy_process(proxyname, test):
'''
Check and execute proxy process
'''
changes_old = []
changes_new = []
if not _is_proxy_running(proxyname):
if not test:
__salt__['cmd.run_all'](
'salt-proxy --proxyid={0} -l info -d'.format(salt.ext.six.moves.shlex_quot... |
def configure_proxy(proxyname, start=True):
'''
Create the salt proxy file and start the proxy process
if required
Parameters:
proxyname:
Name to be used for this proxy (should match entries in pillar)
start:
Boolean indicating if the process should be started
... |
def publish_minions(self):
'''
Publishes minions as a list of dicts.
'''
log.debug('in publish minions')
minions = {}
log.debug('starting loop')
for minion, minion_info in six.iteritems(self.minions):
log.debug(minion)
# log.debug(minion_i... |
def publish(self, key, data):
'''
Publishes the data to the event stream.
'''
publish_data = {key: data}
pub = salt.utils.json.dumps(publish_data) + str('\n\n') # future lint: disable=blacklisted-function
self.handler.write_message(pub) |
def process_minion_update(self, event_data):
'''
Associate grains data with a minion and publish minion update
'''
tag = event_data['tag']
event_info = event_data['data']
mid = tag.split('/')[-1]
if not self.minions.get(mid, None):
self.minions[mid] ... |
def process_ret_job_event(self, event_data):
'''
Process a /ret event returned by Salt for a particular minion.
These events contain the returned results from a particular execution.
'''
tag = event_data['tag']
event_info = event_data['data']
_, _, jid, _, mid = ... |
def process_new_job_event(self, event_data):
'''
Creates a new job with properties from the event data
like jid, function, args, timestamp.
Also sets the initial state to started.
Minions that are participating in this job are also noted.
'''
job = None
... |
def process_key_event(self, event_data):
'''
Tag: salt/key
Data:
{'_stamp': '2014-05-20T22:45:04.345583',
'act': 'delete',
'id': 'compute.home',
'result': True}
'''
tag = event_data['tag']
event_info = event_data['data']
if eve... |
def process_presence_events(self, salt_data, token, opts):
'''
Check if any minions have connected or dropped.
Send a message to the client if they have.
'''
log.debug('In presence')
changed = False
# check if any connections were dropped
if set(salt_data... |
def process(self, salt_data, token, opts):
'''
Process events and publish data
'''
log.debug('In process %s', threading.current_thread())
log.debug(salt_data['tag'])
log.debug(salt_data)
parts = salt_data['tag'].split('/')
if len(parts) < 2:
r... |
def get(tgt, fun, tgt_type='glob', roster='flat'):
'''
Get data from the mine based on the target, function and tgt_type
This will actually run the function on all targeted minions (like
publish.publish), as salt-ssh clients can't update the mine themselves.
We will look for mine_functions in the ... |
def wait_for(func, timeout=10, step=1, default=None, func_args=(), func_kwargs=None):
'''
Call `func` at regular intervals and Waits until the given function returns
a truthy value within the given timeout and returns that value.
@param func:
@type func: function
@param timeout:
@type timeo... |
def get_enabled():
'''
Return a list of service that are enabled on boot
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled
'''
prefix = '/etc/rc[S{0}].d/S'.format(_get_runlevel())
ret = set()
lines = glob.glob('{0}*'.format(prefix))
for line in lines:
... |
def get_all():
'''
Return all available boot services
CLI Example:
.. code-block:: bash
salt '*' service.get_all
'''
ret = set()
lines = glob.glob('/etc/init.d/*')
for line in lines:
service = line.split('/etc/init.d/')[1]
# Remove README. If it's an enabled s... |
def enable(name, **kwargs):
'''
Enable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.enable <service name>
'''
osmajor = _osrel()[0]
if osmajor < '6':
cmd = 'update-rc.d -f {0} defaults 99'.format(_cmd_quote(name))
else:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.