Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	yddl
mZWnek
re
ZnXddlmZd
�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
author:
- Joris Weijters (@molekuul)
module: aix_inittab
short_description: Manages the inittab on AIX
description:
    - Manages the inittab on AIX.
version_added: "2.3"
options:
  name:
    description:
    - Name of the inittab entry.
    type: str
    required: yes
    aliases: [ service ]
  runlevel:
    description:
    - Runlevel of the entry.
    type: str
    required: yes
  action:
    description:
    - Action what the init has to do with this entry.
    type: str
    required: yes
    choices:
    - boot
    - bootwait
    - hold
    - initdefault
    - 'off'
    - once
    - ondemand
    - powerfail
    - powerwait
    - respawn
    - sysinit
    - wait
  command:
    description:
    - What command has to run.
    type: str
    required: yes
  insertafter:
    description:
    - After which inittabline should the new entry inserted.
    type: str
  state:
    description:
    - Whether the entry should be present or absent in the inittab file.
    type: str
    choices: [ absent, present ]
    default: present
notes:
  - The changes are persistent across reboots.
  - You need root rights to read or adjust the inittab with the C(lsitab), C(chitab), C(mkitab) or C(rmitab) commands.
  - Tested on AIX 7.1.
requirements:
- itertools
s�
# Add service startmyservice to the inittab, directly after service existingservice.
- name: Add startmyservice to inittab
  aix_inittab:
    name: startmyservice
    runlevel: 4
    action: once
    command: echo hello
    insertafter: existingservice
    state: present
  become: yes

# Change inittab entry startmyservice to runlevel "2" and processaction "wait".
- name: Change startmyservice to inittab
  aix_inittab:
    name: startmyservice
    runlevel: 2
    action: wait
    command: echo hello
    state: present
  become: yes

- name: Remove startmyservice from inittab
  aix_inittab:
    name: startmyservice
    runlevel: 2
    action: wait
    command: echo hello
    state: absent
  become: yes
sy
name:
    description: Name of the adjusted inittab entry
    returned: always
    type: str
    sample: startmyservice
msg:
    description: Action done with the inittab entry
    returned: changed
    type: str
    sample: changed inittab entry startmyservice
changed:
    description: Whether the inittab changed or not
    returned: always
    type: bool
    sample: true
(tizip(t
AnsibleModulecC`s�itd6}|jd�}|j||jdg�\}}}|dkr�d
}|jd�}td	�|�}tt||��}|jit	d6�n|S(Ntexisttlsitabtnameitrunleveltactiontcommandt:cS`s
|j�S(N(tstrip(ts((sF/usr/lib/python2.7/site-packages/ansible/modules/system/aix_inittab.pyt<lambda>�s(snamesrunlevelsactionscommand(
tFalsetget_bin_pathtrun_commandtparamstsplittmaptdictRtupdatetTrue(tmodulet
existsdictRtrctoutterrtkeystvalues((sF/usr/lib/python2.7/site-packages/ansible/modules/system/aix_inittab.pytcheck_current_entry�s
%c
C`s�tdtdtdddtddg�dtdddt�d	tddd
ddd
dddddddddg�dtdddt�dtdd�dtddddd
ddg��dt�}i|jdd6td6dd 6}|jd!�}|jd"�}|jd#�}d$}t|�}|jddkr|jdd%|jdd%|jd	d%|jd}|d&s�|jd|dks�|jd	|d	ks�|jd|dkr�|d&rI|js�|j||g�\}}}	n|d$kr&|j	d d'd(|d)|	�nd*d+|d|d <t|d<q|d&s|jdr�|js�|j|d,|jd|g�\}}}	q�n*|js�|j||g�\}}}	n|d$kr�|j	d d-d(|d)|	�nd1|jd|d <t|d<qq�n�|jddkr�|d&r�|js�|j||jdg�\}}}	|d$kr�|j	d d/d(|d)|	�q�nd0d+|d|d <t|d<q�n|j
|�dS(2Nt
argument_specRttypetstrtrequiredtaliasestserviceR
Rtchoicestboottbootwaittholdtinitdefaulttofftoncetondemandt	powerfailt	powerwaittrespawntsysinittwaitRtinsertaftertstatetdefaulttpresenttabsenttsupports_check_modetchangedttmsgtmkitabtrmitabtchitabiRR
scould not change inittabRR!schanged inittab entryt s-iscould not adjust inittabsadd inittab entrys$could not remove entry grom inittab)sremoved inittab entrysadd inittab entry (R	RRRRRR$t
check_modeRt	fail_jsont	exit_json(
RtresultRARBRCRt
current_entryt	new_entryR R!((sF/usr/lib/python2.7/site-packages/ansible/modules/system/aix_inittab.pytmain�s�$	
:
	!	


	+	
		t__main__N(t
__future__RRRR&t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNt	itertoolsRtImportErrortziptansible.module_utils.basicR	R$RKt__name__(((sF/usr/lib/python2.7/site-packages/ansible/modules/system/aix_inittab.pyt<module>s 


> 

		a

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