Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/purestorage/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_syslog.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZd
�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys(
---
module: purefa_syslog
version_added: '2.9'
short_description: Configure Pure Storage FlashArray syslog settings
description:
- Configure syslog configuration for Pure Storage FlashArrays.
- Add or delete an individual syslog server to the existing
  list of serves.
author:
- Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
  state:
    description:
    - Create or delete syslog servers configuration
    default: present
    type: str
    choices: [ absent, present ]
  protocol:
    description:
    - Protocol which server uses
    required: true
    type: str
    choices: [ tcp, tls, udp ]
  port:
    description:
    - Port at which the server is listening. If no port is specified
      the system will use 514
    type: str
  address:
    description:
    - Syslog server address.
      This field supports IPv4, IPv6 or FQDN.
      An invalid IP addresses will cause the module to fail.
      No validation is performed for FQDNs.
    type: str
    required: true
extends_documentation_fragment:
- purestorage.fa
s�
- name: Delete existing syslog server entries
  purefa_syslog:
    address: syslog1.com
    protocol: tcp
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Set array syslog servers
  purefa_syslog:
    state: present
    address: syslog1.com
    protocol: udp
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
t
(t
AnsibleModule(t
get_systemtpurefa_argument_speccC`st}|jdd|jd}|jdrG|d|jd}n|}|jdt�d}|r�x�tdt|��D]h}|||kr||=y|jd|�t}PWq�tk
r�|jdd	j	|��q�XqqWn|j
d
|�dS(sDelete Syslog Servertprotocols://taddresstportt:tsyslogserveritmsgs#Failed to remove syslog server: {0}tchangedN(tFalsetparamstgettTruetrangetlentsett	Exceptiont	fail_jsontformatt	exit_json(tmoduletarrayRtnoport_addresstfull_addresstaddress_listR
((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_syslog.pyt
delete_syslogPs"

'cC`st}|jdd|jd}|jdrG|d|jd}n|}|jdt�d}t}|r�x:tdt|��D] }|||kr�t}Pq�q�Wn|s	y'|j|�|jd|�t}Wq	tk
r|j	dd	j
|��q	Xn|jd
|�dS(sAdd Syslog ServerRs://R
RRRiRs Failed to add syslog server: {0}RN(RRRRRRtappendRRRRR(RRRR R!R"texistsR
((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_syslog.pyt
add_syslogjs(



 cC`s�t�}|jtdtdddt�dtdddddd	gdt�d
tdd�dtdddd
ddd
g���t|dt�}t|�}|jddkr�t||�n
t	||�|j
dt�dS(NR
ttypetstrtrequiredRtchoicesttcpttlstudpRtstatetdefaulttpresenttabsenttsupports_check_modeR(RtupdatetdictRR	RR
RR#R&R(t
argument_specRR((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_syslog.pytmain�s	$%		
t__main__N(t
__future__RRRR't
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicR	tansible.module_utils.pureR
RR#R&R6t__name__(((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_syslog.pyt<module>s


)			

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