Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlZddl
mZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys-
---
module: wakeonlan
version_added: '2.2'
short_description: Send a magic Wake-on-LAN (WoL) broadcast packet
description:
- The C(wakeonlan) module sends magic Wake-on-LAN (WoL) broadcast packets.
options:
  mac:
    description:
    - MAC address to send Wake-on-LAN broadcast packet for.
    required: true
  broadcast:
    description:
    - Network broadcast address to use for broadcasting magic Wake-on-LAN packet.
    default: 255.255.255.255
  port:
    description:
    - UDP port to use for magic Wake-on-LAN packet.
    default: 7
todo:
  - Add arping support to check whether the system is up (before and after)
  - Enable check-mode support (when we have arping support)
  - Does not have SecureOn password support
notes:
  - This module sends a magic packet, without knowing whether it worked
  - Only works if the target system was properly configured for Wake-on-LAN (in the BIOS and/or the OS)
  - Some BIOSes have a different (configurable) Wake-on-LAN boot order (i.e. PXE first).
seealso:
- module: win_wakeonlan
author:
- Dag Wieers (@dagwieers)
s�
- name: Send a magic Wake-on-LAN packet to 00:00:5E:00:53:66
  wakeonlan:
    mac: '00:00:5E:00:53:66'
    broadcast: 192.0.2.23
  delegate_to: localhost

- wakeonlan:
    mac: 00:00:5E:00:53:66
    port: 9
  delegate_to: localhost
s
# Default return values
N(t
AnsibleModule(t	to_nativec

C`s�|}t|�dkr1|j|dd�}nt|�dkrZ|jdd|�nyt|d�Wn%tk
r�|jdd|�nXd}djd	|d
g�}xUtdt|�d�D];}dj|tjdt|||d!d��g�}q�Wt	j	t	j
t	j�}|jt	j
t	jd
�|js�y|j|||f�Wq�t	jk
r�}	|j�|jdt|	�dtj��q�Xn|j�dS(s" Send a magic Wake-on-LAN packet. iiittmsgs Incorrect MAC address length: %sis Incorrect MAC address format: %stFFFFFFFFFFFFiitBit	exceptionNi(tlentreplacet	fail_jsontintt
ValueErrortjointrangetstructtpacktsockettAF_INETt
SOCK_DGRAMt
setsockoptt
SOL_SOCKETtSO_BROADCASTt
check_modetsendtoterrortcloseR	t	tracebackt
format_exc(
tmoduletmact	broadcasttporttmac_origtdatatpaddingtitsockte((sO/usr/lib/python2.7/site-packages/ansible/modules/remote_management/wakeonlan.pyt	wakeonlanIs,
9	
)c
C`s�tdtdtdddt�dtdddd�d	tdd
dd��dt�}|jd}|jd}|jd	}t||||�|jd
t�dS(Nt
argument_specR%ttypetstrtrequiredR&tdefaults255.255.255.255R'Ritsupports_check_modetchanged(RtdicttTruetparamsR.t	exit_json(R$R%R&R'((sO/usr/lib/python2.7/site-packages/ansible/modules/remote_management/wakeonlan.pytmainqs	


t__main__(t
__future__RRRR0t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRRR"tansible.module_utils.basicRtansible.module_utils._textR	R.R:t__name__(((sO/usr/lib/python2.7/site-packages/ansible/modules/remote_management/wakeonlan.pyt<module>s 


"
	(	

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