Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/system/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/system/pam_limits.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	Z	dd
l
Z	dd
lZdd
lZddl
mZddlmZd
�Zedkr�e�nd
S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: pam_limits
version_added: "2.0"
author:
    - "Sebastien Rohaut (@usawa)"
short_description: Modify Linux PAM limits
description:
     - The C(pam_limits) module modifies PAM limits. The default file is
       C(/etc/security/limits.conf). For the full documentation, see C(man 5
       limits.conf).
options:
  domain:
    description:
      - A username, @groupname, wildcard, uid/gid range.
    required: true
  limit_type:
    description:
      - Limit type, see C(man 5 limits.conf) for an explanation
    required: true
    choices: [ "hard", "soft", "-" ]
  limit_item:
    description:
      - The limit to be set
    required: true
    choices:
        - "core"
        - "data"
        - "fsize"
        - "memlock"
        - "nofile"
        - "rss"
        - "stack"
        - "cpu"
        - "nproc"
        - "as"
        - "maxlogins"
        - "maxsyslogins"
        - "priority"
        - "locks"
        - "sigpending"
        - "msgqueue"
        - "nice"
        - "rtprio"
        - "chroot"
  value:
    description:
      - The value of the limit.
    required: true
  backup:
    description:
      - Create a backup file including the timestamp information so you can get
        the original file back if you somehow clobbered it incorrectly.
    required: false
    type: bool
    default: "no"
  use_min:
    description:
      - If set to C(yes), the minimal value will be used or conserved.
        If the specified value is inferior to the value in the file, file content is replaced with the new value,
        else content is not modified.
    required: false
    type: bool
    default: "no"
  use_max:
    description:
      - If set to C(yes), the maximal value will be used or conserved.
        If the specified value is superior to the value in the file, file content is replaced with the new value,
        else content is not modified.
    required: false
    type: bool
    default: "no"
  dest:
    description:
      - Modify the limits.conf path.
    required: false
    default: "/etc/security/limits.conf"
  comment:
    description:
      - Comment associated with the limit.
    required: false
    default: ''
notes:
  - If C(dest) file doesn't exist, it is created.
s�
- name: Add or modify nofile soft limit for the user joe
  pam_limits:
    domain: joe
    limit_type: soft
    limit_item: nofile
    value: 64000

- name: Add or modify fsize hard limit for the user smith. Keep or set the maximal value.
  pam_limits:
    domain: smith
    limit_type: hard
    limit_item: fsize
    value: 1000000
    use_max: yes

- name: Add or modify memlock, both soft and hard, limit for the user james with a comment.
  pam_limits:
    domain: james
    limit_type: '-'
    limit_item: memlock
    value: unlimited
    comment: unlimited memory lock for james

- name: Add or modify hard nofile limits for wildcard domain
  pam_limits:
    domain: '*'
    limit_type: hard
    limit_item: nofile
    value: 39693561
N(t
AnsibleModule(t	to_nativec!C`s�ddddddddd	d
ddd
ddddddg}dddg}d}tdtdtdtdd�dtdtddd|�dtdtddd|�d tdtdd�d!td"tdd#�d$td"tdd#�d%td"tdd#�d&td"|dd�d'tdtd"d(dd��	�}|jd}|jd}|jd}|jd }|jd!}|jd$}	|jd%}
|jd&}|jd'}t}tjj|�r�tj|tj	�sZ|j
d)d*|�qZnitjj|�}
tjj|
�rFtj|
tj	�rFt
|d+�j�t}n|j
d)d,|
�|ry|	ry|j
d)d-�n|dEkp�|j�s�|j
d)d1�n|
r�|j|�}ntjd2�}d(}t
|d3�}tjd4d5�}t}|}x|D]}t|d6d7�}|jd8�r?|j|�qntj|d9|�j�}|ss|j|�qn|jd8d:�d;}y|jd8d:�d:}Wntk
r�d(}nX|j�}|s�|}n|jd9�}t|�d<kr|j|�qn|d;}|d:}|d=}|d>}|dFkpI|j�si|j
d)d?||f�n||kr�||kr�||kr�t}||kr�|}|j|�qn|dGk}|dHk}|r*|j�r|j�rttt |�t |���}q*|r!|}q*|}n|	r�|j�rl|j�rltt!t |�t |���}q�|r{|}q�|}n||kr�t}|r�d@|}n|dA|dA|dA||dB}|}|j|�q|}|j|�q|j|�qW|sgt}|r+d@|}n|dA|dA|dA||dB}|}|j|�n|j�|j"�|j#|j$|j$�y|j�Wntk
r�nXtdC|d)|�} |
r�|| dD<n|j%| �dS(INtcoretdatatfsizetmemlocktnofiletrsststacktcputnproctast	maxloginstmaxsysloginstprioritytlockst
sigpendingtmsgqueuetnicetrtpriotchroottsoftthardt-s/etc/security/limits.conft
argument_spectdomaintrequiredttypetstrt
limit_typetchoicest
limit_itemtvaluetuse_maxtdefaulttbooltuse_mintbackuptdesttcommentttmsgs%s is not writable. Use sudotasFdirectory %s is not writable (check presence, access rights, use sudo)s0Cannot use use_min and use_max at the same time.t	unlimitedtinfinitys-1sxArgument 'value' can be one of 'unlimited', 'infinity', '-1' or positive number. Refer to manual pages for more details.s\s+trbtmodesw+terrorstsurrogate_or_strictt#t iiiiisBInvalid configuration of '%s'. Current value of %s is unsupported.s	#s	s
tchangedtbackup_file(R3R4s-1(R3R4s-1(R3R4s-1(R3R4s-1(&RtdicttTruetFalsetparamstostpathtisfiletaccesstW_OKt	fail_jsontdirnametisdirtopentclosetisdigittbackup_localtretcompilettempfiletNamedTemporaryFileR	t
startswithtwritetsubtstriptsplitt	ExceptiontrstriptlenR$tmaxtinttmintflushtatomic_movetnamet	exit_json(!t	pam_itemst	pam_typestlimits_conftmoduleR!R%R'R(R)R,R-tnew_commentR;tlimits_conf_dirR<t
space_patterntmessagetftnftfoundt	new_valuetlinetnewlinetold_commenttline_fieldstline_domaint	line_typet	line_itemtactual_valuetactual_value_unlimitedtvalue_unlimitedt	new_limittres_args((sE/usr/lib/python2.7/site-packages/ansible/modules/system/pam_limits.pytmain�s�*!








'	




	




$
$		$		
&
&



t__main__(t
__future__RRRR#t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLESRAtos.pathRORMtansible.module_utils.basicRtansible.module_utils._textR	Rxt__name__(((sE/usr/lib/python2.7/site-packages/ansible/modules/system/pam_limits.pyt<module>s


V 	�

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