def __virtual__():
    cmd = _detect_os()
    if salt.utils.which(cmd):
        return 'apache'
    return (False, 'The apache execution module cannot be loaded: apache is not installed.')
Only load the module if apache is installed
dataset/ETHPy150Open saltstack/salt/salt/modules/apache.py/__virtual__