File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/deb_apache.cpython-310.pyc
Back
o ;j� � @ s� d Z ddlZddlZddlZddlZe�e�ZdZ dZ dd� Zdd� Zd d � Z dd� Zd d� Zdd� Zdd� Zdd� Zdd� Zejjj�d�dd� �Zejjj�d�dd� �ZdS )z� Support for Apache Please note: The functions in here are Debian-specific. Placing them in this separate file will allow them to load only on Debian-based systems, while still loading under the ``apache`` namespace. � NZapachez/etc/apache2/sites-enabledc C s( t � } tjj�| �rtd dkrtS dS )z5 Only load the module if apache is installed � os_family�Debian)Fz9apache execution module not loaded: apache not installed.)� _detect_os�salt�utils�path�which� __grains__�__virtualname__)�cmd� r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/deb_apache.py�__virtual__ s r c C s$ t d dkrdS t d dkrdS dS )zA Apache commands and paths differ depending on packaging r ZRedHatZ apachectlr Z apache2ctl)r r r r r r s r c C sZ | � d�r| }n| � d�}tj�t� d|� ��rdS | dkr+tj�t� d|� ��r+dS dS )aT Checks to see if the specific site symlink is in /etc/apache2/sites-enabled. This will only be functional on Debian-based operating systems (Ubuntu, Mint, etc). CLI Examples: .. code-block:: bash salt '*' apache.check_site_enabled example.com salt '*' apache.check_site_enabled example.com.conf �.conf�/T�defaultz/000-F)�endswith�osr �islink�SITE_ENABLED_DIR)�siteZ site_filer r r �check_site_enabled- s r c C � i }d| g}z t d |dd�}W n ty$ } z|W Y d}~S d}~ww d|d<