mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Audit module documentation (Q to R)
This commit continues the work started in 7d4739d
, putting CLI examples
in bash code-blocks to give them syntax highlighting on
docs.saltstack.com.
This commit is contained in:
parent
8ab65b2d47
commit
6f332cdeff
@ -13,6 +13,7 @@ import os
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load if qemu-img is installed
|
||||
@ -27,7 +28,9 @@ def make_image(location, size, fmt):
|
||||
Create a blank virtual machine image file of the specified size in
|
||||
megabytes. The image can be created in any format supported by qemu
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' qemu_img.make_image /tmp/image.qcow 2048 qcow2
|
||||
salt '*' qemu_img.make_image /tmp/image.raw 10240 raw
|
||||
|
@ -38,7 +38,9 @@ def connect(image):
|
||||
'''
|
||||
Activate nbd for an image file.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' qemu_nbd.connect /tmp/image.raw
|
||||
'''
|
||||
@ -72,7 +74,9 @@ def mount(nbd):
|
||||
Pass in the nbd connection device location, mount all partitions and return
|
||||
a dict of mount points
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' qemu_nbd.mount /dev/nbd0
|
||||
'''
|
||||
@ -98,7 +102,9 @@ def init(image):
|
||||
'''
|
||||
Mount the named image via qemu-nbd and return the mounted roots
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' qemu_nbd.init /srv/image.qcow2
|
||||
'''
|
||||
@ -115,9 +121,11 @@ def clear(mnt):
|
||||
empty dict, otherwise return a dict containing the still mounted
|
||||
partitions
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
salt '*' qemu_nbd.clear '{/mnt/foo: /dev/nbd0p1}'
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' qemu_nbd.clear '{"/mnt/foo": "/dev/nbd0p1"}'
|
||||
'''
|
||||
if isinstance(mnt, str):
|
||||
mnt = yaml.load(mnt)
|
||||
|
@ -30,7 +30,9 @@ def report(mount):
|
||||
'''
|
||||
Report on quotas for a specific volume
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' quota.report /media/data
|
||||
'''
|
||||
@ -89,7 +91,9 @@ def set_(device, **kwargs):
|
||||
'''
|
||||
Calls out to setquota, for a specific user or group
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' quota.set /media/data user=larry block-soft-limit=1048576
|
||||
salt '*' quota.set /media/data group=painters file-hard-limit=1000
|
||||
@ -143,7 +147,9 @@ def warn():
|
||||
Runs the warnquota command, to send warning emails to users who
|
||||
are over their quota limit.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' quota.warn
|
||||
'''
|
||||
@ -154,7 +160,9 @@ def stats():
|
||||
'''
|
||||
Runs the quotastats command, and returns the parsed output
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' quota.stats
|
||||
'''
|
||||
@ -173,7 +181,9 @@ def on(device):
|
||||
'''
|
||||
Turns on the quota system
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' quota.on
|
||||
'''
|
||||
@ -186,7 +196,9 @@ def off(device):
|
||||
'''
|
||||
Turns off the quota system
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' quota.off
|
||||
'''
|
||||
@ -199,7 +211,9 @@ def get_mode(device):
|
||||
'''
|
||||
Report whether the quota system for this device is on or off
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' quota.get_mode
|
||||
'''
|
||||
|
@ -37,7 +37,9 @@ def list_users(runas=None):
|
||||
'''
|
||||
Return a list of users based off of rabbitmqctl user_list.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.list_users
|
||||
'''
|
||||
@ -58,7 +60,9 @@ def list_vhosts(runas=None):
|
||||
'''
|
||||
Return a list of vhost based on rabbitmqctl list_vhosts.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.list_vhosts
|
||||
'''
|
||||
@ -73,7 +77,9 @@ def user_exists(name, runas=None):
|
||||
'''
|
||||
Return whether the user exists based on rabbitmqctl list_users.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.user_exists rabbit_user
|
||||
'''
|
||||
@ -87,7 +93,9 @@ def vhost_exists(name, runas=None):
|
||||
'''
|
||||
Return whether the vhost exists based on rabbitmqctl list_vhosts.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.vhost_exists rabbit_host
|
||||
'''
|
||||
@ -98,7 +106,9 @@ def add_user(name, password, runas=None):
|
||||
'''
|
||||
Add a rabbitMQ user via rabbitmqctl user_add <user> <password>
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.add_user rabbit_user password
|
||||
'''
|
||||
@ -114,7 +124,9 @@ def delete_user(name, runas=None):
|
||||
'''
|
||||
Deletes a user via rabbitmqctl delete_user.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.delete_user rabbit_user
|
||||
'''
|
||||
@ -129,7 +141,9 @@ def change_password(name, password, runas=None):
|
||||
'''
|
||||
Changes a user's password.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.change_password rabbit_user password
|
||||
'''
|
||||
@ -145,7 +159,9 @@ def clear_password(name, runas=None):
|
||||
'''
|
||||
Removes a user's password.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.clear_password rabbit_user
|
||||
'''
|
||||
@ -160,7 +176,9 @@ def add_vhost(vhost, runas=None):
|
||||
'''
|
||||
Adds a vhost via rabbitmqctl add_vhost.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq add_vhost '<vhost_name>'
|
||||
'''
|
||||
@ -175,7 +193,9 @@ def delete_vhost(vhost, runas=None):
|
||||
'''
|
||||
Deletes a vhost rabbitmqctl delete_vhost.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.delete_vhost '<vhost_name>'
|
||||
'''
|
||||
@ -190,7 +210,9 @@ def set_permissions(vhost, user, conf='.*', write='.*', read='.*',
|
||||
'''
|
||||
Sets permissions for vhost via rabbitmqctl set_permissions
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.set_permissions 'myvhost' 'myuser'
|
||||
'''
|
||||
@ -206,7 +228,9 @@ def list_user_permissions(name, user=None):
|
||||
'''
|
||||
List permissions for a user via rabbitmqctl list_user_permissions
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.list_user_permissions 'user'.
|
||||
'''
|
||||
@ -220,7 +244,9 @@ def status(user=None):
|
||||
'''
|
||||
return rabbitmq status
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.status
|
||||
'''
|
||||
@ -235,7 +261,9 @@ def cluster_status(user=None):
|
||||
'''
|
||||
return rabbitmq cluster_status
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.cluster_status
|
||||
'''
|
||||
@ -251,7 +279,9 @@ def stop_app(runas=None):
|
||||
'''
|
||||
Stops the RabbitMQ application, leaving the Erlang node running.
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.stop_app
|
||||
'''
|
||||
@ -266,7 +296,9 @@ def start_app(runas=None):
|
||||
'''
|
||||
Start the RabbitMQ application.
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.start_app
|
||||
'''
|
||||
@ -281,7 +313,9 @@ def reset(runas=None):
|
||||
'''
|
||||
Return a RabbitMQ node to its virgin state
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.reset
|
||||
'''
|
||||
@ -296,7 +330,9 @@ def force_reset(runas=None):
|
||||
'''
|
||||
Forcefully Return a RabbitMQ node to its virgin state
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.force_reset
|
||||
'''
|
||||
@ -306,11 +342,14 @@ def force_reset(runas=None):
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def list_queues(*kwargs):
|
||||
'''
|
||||
Returns queue details of the / virtual host
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.list_queues messages consumers
|
||||
'''
|
||||
@ -318,14 +357,17 @@ def list_queues(*kwargs):
|
||||
'rabbitmqctl list_queues {0}'.format(' '.join(list(kwargs))))
|
||||
return res
|
||||
|
||||
|
||||
def list_queues_vhost(vhost, *kwargs):
|
||||
'''
|
||||
Returns queue details of specified virtual host.
|
||||
This command will consider first parameter as the vhost name and rest will be treated as queueinfoitem.
|
||||
Also rabbitmqctl's -p parameter will be passed by salt, it should not be provided by salt command
|
||||
For getting details on vhost '/', use list_queues instead).
|
||||
Returns queue details of specified virtual host. This command will consider
|
||||
first parameter as the vhost name and rest will be treated as
|
||||
queueinfoitem. For getting details on vhost ``/``, use :mod:`list_queues
|
||||
<salt.modules.rabbitmq.list_queues>` instead).
|
||||
|
||||
Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rabbitmq.list_queues messages consumers
|
||||
'''
|
||||
|
@ -102,7 +102,9 @@ def install(runas=None, path=None):
|
||||
'''
|
||||
Install Rbenv systemwide
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.install
|
||||
'''
|
||||
@ -116,7 +118,9 @@ def update(runas=None, path=None):
|
||||
'''
|
||||
Updates the current versions of Rbenv and Ruby-Build
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.update
|
||||
'''
|
||||
@ -131,7 +135,9 @@ def is_installed(runas=None):
|
||||
'''
|
||||
Check if Rbenv is installed.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.is_installed
|
||||
'''
|
||||
@ -146,7 +152,9 @@ def install_ruby(ruby, runas=None):
|
||||
The version of Ruby to install, should match one of the
|
||||
versions listed by rbenv.list
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.install_ruby 2.0.0-p0
|
||||
'''
|
||||
@ -172,10 +180,12 @@ def uninstall_ruby(ruby, runas=None):
|
||||
Uninstall a ruby implementation.
|
||||
|
||||
ruby
|
||||
The version of ruby to uninstall. Should match one of
|
||||
the versions listed by rbenv.versions
|
||||
The version of ruby to uninstall. Should match one of the versions
|
||||
listed by :mod:`rbenv.versions <salt.modules.rbenv.versions>`
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.uninstall_ruby 2.0.0-p0
|
||||
'''
|
||||
@ -191,7 +201,9 @@ def versions(runas=None):
|
||||
'''
|
||||
List the installed versions of ruby.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.versions
|
||||
'''
|
||||
@ -205,15 +217,15 @@ def default(ruby=None, runas=None):
|
||||
Returns or sets the currently defined default ruby.
|
||||
|
||||
ruby=None
|
||||
The version to set as the default. Should match one of
|
||||
the versions listed by rbenv.versions.
|
||||
Leave blank to return the current default.
|
||||
The version to set as the default. Should match one of the versions
|
||||
listed by :mod:`rbenv.versions <salt.modules.rbenv.versions>`. Leave
|
||||
blank to return the current default.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.default
|
||||
# 2.0.0-p0
|
||||
|
||||
salt '*' rbenv.default 2.0.0-p0
|
||||
'''
|
||||
|
||||
@ -229,7 +241,9 @@ def list_(runas=None):
|
||||
'''
|
||||
List the installable versions of ruby.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rbenv.list
|
||||
'''
|
||||
|
@ -32,7 +32,9 @@ def enable():
|
||||
'''
|
||||
Enable RDP the service on the server
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rdp.enable
|
||||
'''
|
||||
@ -44,7 +46,9 @@ def disable():
|
||||
'''
|
||||
Disable RDP the service on the server
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rdp.disable
|
||||
'''
|
||||
@ -56,7 +60,9 @@ def status():
|
||||
'''
|
||||
Show if rdp is enabled on the server
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rdp.status
|
||||
'''
|
||||
|
@ -38,6 +38,7 @@ class Registry(object):
|
||||
"HKEY_CURRENT_USER": _winreg.HKEY_CURRENT_USER,
|
||||
"HKEY_LOCAL_MACHINE": _winreg.HKEY_LOCAL_MACHINE,
|
||||
}
|
||||
|
||||
def __getattr__(self, k):
|
||||
try:
|
||||
return self.hkeys[k]
|
||||
@ -46,6 +47,7 @@ class Registry(object):
|
||||
hkeys = ', '.join(self.hkeys)
|
||||
raise CommandExecutionError(msg.format(k, hkeys))
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only works on Windows systems
|
||||
@ -58,11 +60,14 @@ def __virtual__():
|
||||
log.warn(salt.utils.required_modules_error(__file__, __doc__))
|
||||
return False
|
||||
|
||||
|
||||
def read_key(hkey, path, key):
|
||||
'''
|
||||
Read registry key value
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' reg.read_key HKEY_LOCAL_MACHINE 'SOFTWARE\\Salt' 'version'
|
||||
'''
|
||||
@ -84,7 +89,9 @@ def set_key(hkey, path, key, value, vtype='REG_DWORD'):
|
||||
Set a registry key
|
||||
vtype: http://docs.python.org/2/library/_winreg.html#value-types
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' reg.set_key HKEY_CURRENT_USER 'SOFTWARE\\Salt' 'version' '0.97' REG_DWORD
|
||||
'''
|
||||
@ -114,7 +121,9 @@ def create_key(hkey, path, key, value=None):
|
||||
'''
|
||||
Create a registry key
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' reg.create_key HKEY_CURRENT_USER 'SOFTWARE\\Salt' 'version' '0.97'
|
||||
'''
|
||||
@ -140,7 +149,9 @@ def delete_key(hkey, path, key):
|
||||
|
||||
Note: This cannot delete a key with subkeys
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' reg.delete_key HKEY_CURRENT_USER 'SOFTWARE\\Salt' 'version'
|
||||
'''
|
||||
|
@ -11,7 +11,9 @@ def get_jid(returner, jid):
|
||||
'''
|
||||
Return the information for a specified job id
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ret.get_jid redis 20421104181954700505
|
||||
'''
|
||||
@ -23,7 +25,9 @@ def get_fun(returner, fun):
|
||||
'''
|
||||
Return info about last time fun was called on each minion
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ret.get_fun mysql network.interfaces
|
||||
'''
|
||||
@ -35,7 +39,9 @@ def get_jids(returner):
|
||||
'''
|
||||
Return a list of all job ids
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ret.get_jids mysql
|
||||
'''
|
||||
@ -47,7 +53,9 @@ def get_minions(returner):
|
||||
'''
|
||||
Return a list of all minions
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ret.get_minions mysql
|
||||
'''
|
||||
|
@ -792,7 +792,9 @@ def build_bond(iface, **settings):
|
||||
Create a bond script in /etc/modprobe.d with the passed settings
|
||||
and load the bonding kernel module.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.build_bond bond0 mode=balance-alb
|
||||
'''
|
||||
@ -827,7 +829,9 @@ def build_interface(iface, iface_type, enabled, **settings):
|
||||
'''
|
||||
Build an interface script for a network interface.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.build_interface eth0 eth <settings>
|
||||
'''
|
||||
@ -881,7 +885,9 @@ def build_routes(iface, **settings):
|
||||
'''
|
||||
Build a route script for a network interface.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.build_routes eth0 <settings>
|
||||
'''
|
||||
@ -910,7 +916,9 @@ def down(iface, iface_type):
|
||||
'''
|
||||
Shutdown a network interface
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.down eth0
|
||||
'''
|
||||
@ -924,7 +932,9 @@ def get_bond(iface):
|
||||
'''
|
||||
Return the content of a bond script
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.get_bond bond0
|
||||
'''
|
||||
@ -936,7 +946,9 @@ def get_interface(iface):
|
||||
'''
|
||||
Return the contents of an interface script
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.get_interface eth0
|
||||
'''
|
||||
@ -948,7 +960,9 @@ def up(iface, iface_type): # pylint: disable=C0103
|
||||
'''
|
||||
Start up a network interface
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.up eth0
|
||||
'''
|
||||
@ -962,7 +976,9 @@ def get_routes(iface):
|
||||
'''
|
||||
Return the contents of the interface routes script.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.get_routes eth0
|
||||
'''
|
||||
@ -974,7 +990,9 @@ def get_network_settings():
|
||||
'''
|
||||
Return the contents of the global network script.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.get_network_settings
|
||||
'''
|
||||
@ -985,7 +1003,9 @@ def apply_network_settings(**settings):
|
||||
'''
|
||||
Apply global network configuration.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.apply_network_settings
|
||||
'''
|
||||
@ -1006,7 +1026,9 @@ def build_network_settings(**settings):
|
||||
'''
|
||||
Build the global network script.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' ip.build_network_settings <settings>
|
||||
'''
|
||||
|
@ -205,7 +205,9 @@ def get_enabled(limit=''):
|
||||
Return the enabled services. Use the ``limit`` param to restrict results
|
||||
to services of that type.
|
||||
|
||||
CLI Examples::
|
||||
CLI Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.get_enabled
|
||||
salt '*' service.get_enabled limit=upstart
|
||||
@ -233,7 +235,9 @@ def get_disabled(limit=''):
|
||||
Return the disabled services. Use the ``limit`` param to restrict results
|
||||
to services of that type.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.get_disabled
|
||||
salt '*' service.get_disabled limit=upstart
|
||||
@ -261,7 +265,9 @@ def get_all(limit=''):
|
||||
Return all installed services. Use the ``limit`` param to restrict results
|
||||
to services of that type.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.get_all
|
||||
salt '*' service.get_all limit=upstart
|
||||
@ -281,7 +287,9 @@ def available(name, limit=''):
|
||||
Return True is the named service is available. Use the ``limit`` param to
|
||||
restrict results to services of that type.
|
||||
|
||||
CLI Examples::
|
||||
CLI Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.get_enabled
|
||||
salt '*' service.get_enabled limit=upstart
|
||||
@ -299,7 +307,9 @@ def start(name):
|
||||
'''
|
||||
Start the specified service
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.start <service name>
|
||||
'''
|
||||
@ -314,7 +324,9 @@ def stop(name):
|
||||
'''
|
||||
Stop the specified service
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.stop <service name>
|
||||
'''
|
||||
@ -329,7 +341,9 @@ def restart(name, **kwargs):
|
||||
'''
|
||||
Restart the named service
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.restart <service name>
|
||||
'''
|
||||
@ -344,7 +358,9 @@ def reload_(name, **kwargs):
|
||||
'''
|
||||
Reload the named service
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.reload <service name>
|
||||
'''
|
||||
@ -360,7 +376,9 @@ def status(name, sig=None):
|
||||
Return the status for a service, returns a bool whether the service is
|
||||
running.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.status <service name>
|
||||
'''
|
||||
@ -377,7 +395,9 @@ def enable(name, **kwargs):
|
||||
'''
|
||||
Enable the named service to start at boot
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.enable <service name>
|
||||
'''
|
||||
@ -391,7 +411,9 @@ def disable(name, **kwargs):
|
||||
'''
|
||||
Disable the named service to start at boot
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.disable <service name>
|
||||
'''
|
||||
@ -405,7 +427,9 @@ def enabled(name):
|
||||
'''
|
||||
Check to see if the named service is enabled to start on boot
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.enabled <service name>
|
||||
'''
|
||||
@ -419,7 +443,9 @@ def disabled(name):
|
||||
'''
|
||||
Check to see if the named service is disabled to start on boot
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.disabled <service name>
|
||||
'''
|
||||
|
@ -9,6 +9,7 @@ Author: David Boucha <boucha@gmail.com>
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only available on systems with Riak installed.
|
||||
@ -22,7 +23,9 @@ def start():
|
||||
'''
|
||||
Start Riak
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' riak.start
|
||||
'''
|
||||
@ -33,7 +36,9 @@ def stop():
|
||||
'''
|
||||
Stop Riak
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' riak.stop
|
||||
'''
|
||||
@ -44,7 +49,9 @@ def cluster_join(riak_user=None, riak_host=None):
|
||||
'''
|
||||
Join a Riak cluster
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' riak.cluster_join <user> <host>
|
||||
'''
|
||||
@ -59,7 +66,9 @@ def cluster_plan():
|
||||
'''
|
||||
Review Cluster Plan
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' riak.cluster_plan
|
||||
'''
|
||||
@ -70,7 +79,9 @@ def cluster_commit():
|
||||
'''
|
||||
Commit Cluster Changes
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' riak.cluster_commit
|
||||
'''
|
||||
@ -81,7 +92,9 @@ def member_status():
|
||||
'''
|
||||
Get cluster member status
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' riak.member_status
|
||||
'''
|
||||
|
@ -44,7 +44,9 @@ def list_pkgs(*packages):
|
||||
|
||||
{'<package_name>': '<version>'}
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' lowpkg.list_pkgs
|
||||
'''
|
||||
@ -69,7 +71,9 @@ def verify(*package):
|
||||
'''
|
||||
Runs an rpm -Va on a system, and returns the results in a dict
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' lowpkg.verify
|
||||
'''
|
||||
@ -121,7 +125,9 @@ def file_list(*packages):
|
||||
return a list of _every_ file on the system's rpm database (not generally
|
||||
recommended).
|
||||
|
||||
CLI Examples::
|
||||
CLI Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' lowpkg.file_list httpd
|
||||
salt '*' lowpkg.file_list httpd postfix
|
||||
@ -141,7 +147,9 @@ def file_dict(*packages):
|
||||
any packages will return a list of _every_ file on the system's rpm
|
||||
database (not generally recommended).
|
||||
|
||||
CLI Examples::
|
||||
CLI Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' lowpkg.file_list httpd
|
||||
salt '*' lowpkg.file_list httpd postfix
|
||||
|
@ -53,7 +53,9 @@ def is_installed(runas=None):
|
||||
'''
|
||||
Check if RVM is installed.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.is_installed
|
||||
'''
|
||||
@ -64,7 +66,9 @@ def install(runas=None):
|
||||
'''
|
||||
Install RVM system wide.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.install
|
||||
'''
|
||||
@ -95,7 +99,9 @@ def install_ruby(ruby, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.install_ruby 1.9.3-p385
|
||||
'''
|
||||
@ -116,7 +122,9 @@ def reinstall_ruby(ruby, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.reinstall_ruby 1.9.3-p385
|
||||
'''
|
||||
@ -130,7 +138,9 @@ def list_(runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.list
|
||||
'''
|
||||
@ -156,7 +166,9 @@ def set_default(ruby, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.set_default 2.0.0
|
||||
'''
|
||||
@ -173,7 +185,9 @@ def get(version='stable', runas=None):
|
||||
ruby
|
||||
The version of ruby to reinstall.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.get
|
||||
'''
|
||||
@ -195,7 +209,9 @@ def wrapper(ruby_string, wrapper_prefix, runas=None, *binaries):
|
||||
given, wrappers for ruby, gem, rake, irb, rdoc, ri and testrb are
|
||||
generated.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.wrapper <ruby_string> <wrapper_prefix>
|
||||
'''
|
||||
@ -220,7 +236,9 @@ def rubygems(ruby, version, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.rubygems 2.0.0 1.8.24
|
||||
'''
|
||||
@ -238,7 +256,9 @@ def gemset_create(ruby, gemset, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.gemset_create 2.0.0 foobar
|
||||
'''
|
||||
@ -256,7 +276,9 @@ def gemset_list(ruby='default', runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.gemset_list
|
||||
'''
|
||||
@ -282,7 +304,9 @@ def gemset_delete(ruby, gemset, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.gemset_delete 2.0.0 foobar
|
||||
'''
|
||||
@ -302,7 +326,9 @@ def gemset_empty(ruby, gemset, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.gemset_empty 2.0.0 foobar
|
||||
'''
|
||||
@ -322,7 +348,9 @@ def gemset_copy(source, destination, runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.gemset_copy foobar bazquo
|
||||
'''
|
||||
@ -338,7 +366,9 @@ def gemset_list_all(runas=None):
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.gemset_list_all
|
||||
'''
|
||||
@ -370,7 +400,9 @@ def do(ruby, command, runas=None): # pylint: disable=C0103
|
||||
runas : None
|
||||
The user to run rvm as.
|
||||
|
||||
CLI Example::
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' rvm.do 2.0.0 <command>
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user