Esempio n. 1
0
def __virtual__():
    '''
    This module requires that 'skuba' and 'kubectl' CLI tools are available.
    '''
    if not which('skuba'):
        return (False, 'skuba is not available in the minion')
    if not which('kubectl'):
        return (False, 'kubectl is not available in the minion')
    else:
        return __virtualname__
Esempio n. 2
0
def __virtual__():
    '''
    Check requirements for this module
    '''
    if which('sensuctl'):
        return __virtualname__
    return False, 'sensuctl binary not found'
Esempio n. 3
0
# -*- coding: utf-8 -*-
"""
Add, modify, remove queues from the Common Unix Printing System
"""

import re
import logging
from salt.utils.path import which

log = logging.getLogger(__name__)

lpadmin_path = which('lpadmin')
lpstat_path = which('lpstat')
lpinfo_path = which('lpinfo')
lpoptions_path = which('lpoptions')

__virtualname__ = 'cups'

def __virtual__():
    '''
    Only load if lpadmin exists on the system
    '''
    if not lpadmin_path:
        log.warning("cups module not loading because lpadmin not found in path")
        return False
    else:
        log.info("cups module is available at path: {}".format(lpadmin_path))
        return __virtualname__


def printers():
Esempio n. 4
0
# pylint: disable=import-error

log = logging.getLogger(__name__)

try:
    from salt.utils.path import which
except ImportError:
    from distutils.spawn import which

try:
    # pylint: disable=import-error,3rd-party-module-not-gated,redefined-builtin
    from salt.ext.six.moves import range
except ImportError:
    logging.error("Could not import salt.ext.six.moves -> range")

IPERF_PATH = which('iperf3')

LOCALHOST_NAME = socket.gethostname()
'''
multi is the module to call subprocess in minion host

Ping is a simple test to check if point to point nodes are connected

CLI Example:
.. code-block:: bash
    sudo salt 'node' multi.ping_cmd <hostname>|<ip>
    sudo salt 'node' multi.ping <hostname>|<ip> <hostname>|<ip>....
'''


def _all(func, hosts):
Esempio n. 5
0
 def _raid_may_exist():
     """ If /proc/mdstat is populated or mdadm is installed we may have RAID configured"""
     if os.path.exists('/proc/mdstat') and which('mdadm'):
         return True
     return False