Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/web_infrastructure/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZd
�Z
d�Zd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys0
---
module: apache2_module
version_added: 1.6
author:
    - Christian Berendt (@berendt)
    - Ralf Hertel (@n0trax)
    - Robin Roth (@robinro)
short_description: Enables/disables a module of the Apache2 webserver.
description:
   - Enables or disables a specified module of the Apache2 webserver.
options:
   name:
     description:
        - Name of the module to enable/disable as given to C(a2enmod/a2dismod).
     required: true
   identifier:
     description:
         - Identifier of the module as listed by C(apache2ctl -M).
           This is optional and usually determined automatically by the common convention of
           appending C(_module) to I(name) as well as custom exception for popular modules.
     required: False
     version_added: "2.5"
   force:
     description:
        - Force disabling of default modules and override Debian warnings.
     required: false
     type: bool
     default: False
     version_added: "2.1"
   state:
     description:
        - Desired state of the module.
     choices: ['present', 'absent']
     default: present
   ignore_configcheck:
     description:
        - Ignore configuration checks about inconsistent module configuration. Especially for mpm_* modules.
     type: bool
     default: False
     version_added: "2.3"
requirements: ["a2enmod","a2dismod"]
sX
# enables the Apache2 module "wsgi"
- apache2_module:
    state: present
    name: wsgi
# disables the Apache2 module "wsgi"
- apache2_module:
    state: absent
    name: wsgi
# disable default modules for Debian
- apache2_module:
    state: absent
    name: autoindex
    force: True
# disable mpm_worker and ignore warnings about missing mpm module
- apache2_module:
    state: absent
    name: mpm_worker
    ignore_configcheck: True
# enable dump_io module, which is identified as dumpio_module inside apache2
- apache2_module:
    state: present
    name: dump_io
    identifier: dumpio_module
s�
result:
    description: message about action taken
    returned: always
    type: str
warnings:
    description: list of warning messages
    returned: when needed
    type: list
rc:
    description: return code of underlying command
    returned: failed
    type: int
stdout:
    description: stdout of underlying command
    returned: failed
    type: str
stderr:
    description: stderr of underlying command
    returned: failed
    type: str
N(t
AnsibleModulecC`s>t|�}|jd|�\}}}ttjd|��S(Ns%s -Vsthreaded:[ ]*yes(t_get_ctl_binarytrun_commandtbooltretsearch(tmoduletcontrol_binarytresulttstdouttstderr((sU/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pyt
_run_threadedsscC`sJx3ddgD]%}|j|�}|dk	r
|Sq
W|jdd�dS(Nt
apache2ctlt	apachectltmsgsZNeither of apache2ctl nor apachctl found. At least one apache control binary is necessary.(tget_bin_pathtNonet	fail_json(Rtcommandt
ctl_binary((sU/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pyR	{s	cC`s�t|�}|jd|�\}}}|dkr�d||f}|jdr�d|kr�d|jdkr�|jjd�n|jj|�tS|jd	|�nd
|jd}||kS(Ns%s -MisError executing %s: %stignore_configchecktAH00534tmpm_tnamesoNo MPM module loaded! apache2 reload AND other module actions will fail if no MPM module is loaded immediately.Rt t
identifier(R	R
tparamstwarningstappendtFalseR(RRRRRt	error_msgtsearchstring((sU/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pyt_module_is_enabled�s
	
cC`s�d	d
g}dg}x$|D]\}}||kr|SqWx^|D]V\}}||krCy'tj||�}|jd�dSWq�tk
r�q�XqCqCW|dS(s�
    By convention if a module is loaded via name, it appears in apache2ctl -M as
    name_module.

    Some modules don't follow this convention and we use replacements for those.tshib2tmod_shibtevasivetevasive20_moduletphps
^(php\d)\.it_module(R)R*(R+R,(R-s
^(php\d)\.(RR
tgrouptAttributeError(Rttext_workaroundstre_workaroundsta2enmod_spellingtmodule_nameR
treexprtrematch((sU/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pytcreate_apache_identifier�s			
cC`s�|jd}|jd}|dk}idd6dd6|}idd6dd6|}d	||f}t|�|kr�|jr�|jd
td|d|j�n|j|�}|dkr�|jd
d||f�n|r�|r�|d7}n|j	d||f�\}}	}
t|�|krK|jd
td|d|j�q�dj
d|d|d|	d|jd�}|jd
|d|d|	d|
�n|jd
td|d|j�dS(NRtforcetpresenttenabledtdisabledtabsentta2enmodta2dismodsModule %s %stchangedRR#RsB%s not found. Perhaps this system does not use %s to manage apaches -fs%s %ss�Failed to set module {name} to {state}:
{stdout}
Maybe the module identifier ({identifier}) was guessed incorrectly.Consider setting the "identifier" option.tstateRR!trcR(R"R(t
check_modet	exit_jsontTrueR#RRRR
tformatR%(RR@RR8twant_enabledtstate_stringta2mod_binarytsuccess_msgRRRR((sU/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pyt
_set_state�sB

	


"
	
cC`s*tdtdtdt�dtdtdd�dtdtddd	t�d
td	ddd
dg�dtdtddd	t��dt�}g|_|jd}|dkr�t|�r�|jdd|�n|jds�t|jd�|jd<n|jd
dkr&t	||jd
�ndS(Nt
argument_specRtrequiredR!ttypetstrR8RtdefaultR@R9tchoicesR<Rtsupports_check_modetcgiRsJYour MPM seems to be threaded. No automatic actions on module %s possible.(spresentsabsent(
RtdictRDR%R#R"RRR7RJ(RR((sU/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pytmain�s 		

t__main__(t
__future__RRRRMt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRtansible.module_utils.basicRRR	R(R7RJRTt__name__(((sU/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/apache2_module.pyt<module>s"


-				!	3	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]