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/gunicorn.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
d
�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: gunicorn
version_added: "2.4"
short_description: Run gunicorn with various settings.
description:
     - Starts gunicorn with the parameters specified. Common settings for gunicorn
       configuration are supported. For additional configuration use a config file
       See U(https://gunicorn-docs.readthedocs.io/en/latest/settings.html) for more
       options. It's recommended to always use the chdir option to avoid problems
       with the location of the app.
requirements: [gunicorn]
author:
    - "Alejandro Gomez (@agmezr)"
options:
  app:
    required: true
    aliases: ['name']
    description:
      - The app module. A name refers to a WSGI callable that should be found in the specified module.
  venv:
    aliases: ['virtualenv']
    description:
      - 'Path to the virtualenv directory.'
  config:
    description:
      - 'Path to the gunicorn configuration file.'
  chdir:
    description:
      - 'Chdir to specified directory before apps loading.'
  pid:
    description:
      - 'A filename to use for the PID file. If not set and not found on the configuration file a tmp
         pid file will be created to check a successful run of gunicorn.'
  worker:
    choices: ['sync', 'eventlet', 'gevent', 'tornado ', 'gthread', 'gaiohttp']
    description:
      - 'The type of workers to use. The default class (sync) should handle most "normal" types of workloads.'
  user:
    description:
      -  'Switch worker processes to run as this user.'
notes:
  - If not specified on config file, a temporary error log will be created on /tmp dir.
    Please make sure you have write access in /tmp dir. Not needed but will help you to
    identify any problem with configuration.
s�
- name: simple gunicorn run example
  gunicorn:
    app: 'wsgi'
    chdir: '/workspace/example'

- name: run gunicorn on a virtualenv
  gunicorn:
    app: 'wsgi'
    chdir: '/workspace/example'
    venv: '/workspace/example/venv'

- name: run gunicorn with a config file
  gunicorn:
    app: 'wsgi'
    chdir: '/workspace/example'
    conf: '/workspace/example/gunicorn.cfg'

- name: run gunicorn as ansible user with specified pid and config file
  gunicorn:
    app: 'wsgi'
    chdir: '/workspace/example'
    conf: '/workspace/example/gunicorn.cfg'
    venv: '/workspace/example/venv'
    pid: '/workspace/example/gunicorn.pid'
    user: 'ansible'
sj
gunicorn:
    description: process id of gunicorn
    returned: changed
    type: str
    sample: "1234"
N(t
AnsibleModulecC`s^|rZtjj|�rZd}t|d��(}x|D]}||kr7|Sq7WWdQXndS(s, search in config file for specified option trN(tostpathtisfiletNonetopen(tconfigtoptiontdata_configtftline((sO/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/gunicorn.pytsearch_existing_configjs
cC`s&tjj|�r"tj|�ndS(s remove temporary files N(R
RRtremove(t	file_path((sO/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/gunicorn.pytremove_tmp_fileuscC`s�idd6dd6dd6dd6}td	td
tdtdd
ddg�dtdtddddddg�dtdtddddddg�dtdtdddd�dtdtdddd�dtdtdd
�dtdtdd
dddddddg���}tjj|jd�}tjj|jd�}t	|�t	|�|j
}|d
}|d}|d}|r�dj|d d!f�}nd!}d"g}	x?|D]7}
||
}|r�|	j||
�|	j|�q�q�Wt|dd#�}|s%|	jd$�|	j|�nt|dd�}
|drS|
rS|}n|
sv|	jd%�|	j|�n|g|	|g}|j
|d&td'd�\}}}|s�tjd(�tjj|�r?t|d)��}|j�j�}WdQX|dstj|�n|jd*td|d+d,j|��q�|r]d-j|j��}nLtjj|�r�t|d)��}|j�}WdQXtj|�nd.}|jd/d0j|�d1|�n|jd/d2j|�d1|�dS(3Ns-cRs--chdirtchdirs-ktworkers-utusert
argument_spectapptrequiredttypetstrtaliasestnametvenvRtdefaultt
virtualenvtconftpidtchoicestsyncteventlettgeventstornado tgthreadtgaiohttpsgunicorn.temp.error.logsgunicorn.temp.pidt/tbintgunicorns-Dterrorlogs--error-logfiles--pidtuse_unsafe_shelltencodingg�?R	tchangedtdebugt sPlease check your {0}s
Log not foundtmsgsFailed to start gunicorn. {0}terrorsFailed to start gunicorn {0}(RtdicttTruetFalseR
R
RtjointtmpdirRtparamstappendRtrun_commandttimetsleepRRtreadlinetstripRt	exit_jsontformattreadt	fail_json(tgunicorn_optionstmodulet
tmp_error_logttmp_pid_fileR=RR"R&tgunicorn_commandtoptionsRtparamt	error_logtpid_filetargstrctoutterrRtresultR7((sO/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/gunicorn.pytmain{s|
$$!

	


	


	
$

("t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR
R@tansible.module_utils.basicRRRRVt__name__(((sO/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/gunicorn.pyt<module>s


0			h

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