Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/edgeos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyo

�
�Udac@`s6ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZdefd��YZdefd��YZdefd��YZdefd��YZededede�Zeej��Zd�Zedkr2e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: edgeos_facts
version_added: "2.5"
author:
    - Nathaniel Case (@Qalthos)
    - Sam Doran (@samdoran)
short_description: Collect facts from remote devices running EdgeOS
description:
  - Collects a base set of device facts from a remote device that
    is running EdgeOS. This module prepends all of the
    base network fact keys with U(ansible_net_<fact>). The facts
    module will always collect a base set of facts from the device
    and can enable or disable collection of additional facts.
notes:
  - Tested against EdgeOS 1.9.7
options:
  gather_subset:
    description:
      - When supplied, this argument will restrict the facts collected
        to a given subset. Possible values for this argument include
        all, default, config, and neighbors. Can specify a list of
        values to include a larger subset. Values can also be used
        with an initial C(M(!)) to specify that a specific subset should
        not be collected.
    required: false
    default: "!config"
s

- name: collect all facts from the device
  edgeos_facts:
    gather_subset: all

- name: collect only the config and default facts
  edgeos_facts:
    gather_subset: config

- name: collect everything exception the config
  edgeos_facts:
    gather_subset: "!config"
sc
ansible_net_config:
  description: The running-config from the device
  returned: when config is configured
  type: str
ansible_net_commits:
  description: The set of available configuration revisions
  returned: when present
  type: list
ansible_net_hostname:
  description: The configured system hostname
  returned: always
  type: str
ansible_net_model:
  description: The device model string
  returned: always
  type: str
ansible_net_serialnum:
  description: The serial number of the device
  returned: always
  type: str
ansible_net_version:
  description: The version of the software running
  returned: always
  type: str
ansible_net_neighbors:
  description: The set of LLDP neighbors
  returned: when interface is configured
  type: list
ansible_net_gather_subset:
  description: The list of subsets gathered by the module
  returned: always
  type: list
N(t
AnsibleModule(t	iteritems(trun_commandst	FactsBasecB`s#eZe�Zd�Zd�ZRS(cC`s"||_t�|_d|_dS(N(tmoduletdicttfactstNonet	responses(tselfR((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyt__init__hs	cC`s"t|jt|j��|_dS(N(R
RtlisttCOMMANDSR(R((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pytpopulatems(t__name__t
__module__t	frozensetRRR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyRds		tDefaultcB`s8eZddgZd�Zd�Zd�Zd�ZRS(sshow versionsshow host namecC`sztt|�j�|jd}|j|�|jd<|j|�|jd<|j|�|jd<|jd|jd<dS(Nitversiont	serialnumtmodelithostname(tsuperRRRt
parse_versionRtparse_serialnumtparse_model(Rtdata((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyRxs
cC`s)tjd|�}|r%|jd�SdS(NsVersion:\s*v(\S+)i(tretsearchtgroup(RR"tmatch((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR�scC`s)tjd|�}|r%|jd�SdS(NsHW model:\s*([A-Za-z0-9- ]+)i(R#R$R%(RR"R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR!�scC`s)tjd|�}|r%|jd�SdS(NsHW S/N:\s+(\S+)i(R#R$R%(RR"R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR �s(RRRRRR!R (((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyRqs		
		tConfigcB`seZddgZd�ZRS(sshow configuration commandssshow system commitcC`stt|�j�|j|jd<|jd}t�}d}x�|jd�D]�}tj	d|�}|r�|r�|j
|�ntd|jd�d|jd�dt
|jd	��j�d
t
|jd��j�dd�}qO|rO|j�|d<qOqOW||jd
<dS(Ntconfigis
s(\d+)\s+(.+)by(.+)via(.+)trevisiontdatetimeitbyitviaitcommenttcommits(RR'RRRRRtsplitR#R&tappendR
R%tstrtstrip(RR.tentriestentrytlineR&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR�s$
	(RRRR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR'�s	t	NeighborscB`sJeZddgZd�Zd�Zd�Zd�Zd�Zd�ZRS(sshow lldp neighborssshow lldp neighbors detailcC`s_tt|�j�|jd}d|kr[|j|jd�}|j|�|jd<ndS(NisLLDP not configuredit	neighbors(RR6RRtparsetparse_neighborsR(Rt
all_neighborsR7((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR�s
cC`s�t�}d}xr|jd�D]a}|s1qq|ddkrR|d|7}q|jd�r|rw|j|�n|}qqW|r�|j|�n|S(Ns
it s
%st	Interface(RRR/t
startswithR0(RR"tparsedtvaluesR5((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR8�s	
cC`s�t�}xw|D]o}|j|�}|j|�}|j|�}||kr_t�||<n||jtd|d|��qW|S(Nthosttport(R
tparse_interfacet
parse_hostt
parse_portRR0(RR"Rtitemt	interfaceR@RA((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR9�s	
$cC`stjd|�}|jd�S(Ns^Interface:\s+(\S+),i(R#R$R%(RR"R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyRB�scC`s/tjd|tj�}|r+|jd�SdS(NsSysName:\s+(.+)$i(R#R$tMR%(RR"R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyRC�scC`s/tjd|tj�}|r+|jd�SdS(NsPortDescr:\s+(.+)$i(R#R$RGR%(RR"R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyRD�s(	RRRRR8R9RBRCRD(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyR6�s		
				tdefaultR7R(cC`s#tdtddgdd��}td|dt�}t�}|jd}t�}t�}x�|D]�}|dkr�|jt�qen|jd	�r�|d
}|dkr�|jt�qent}nt	}|tkr|j
ddd
jt�|f�n|r|j|�qe|j|�qeW|s@|jt�n|j
|�|jd�t�}t|�|d<t�}	x%|D]}
|	jt|
|��q�Wx(|	D] }|j�|j|j�q�Wt�}x.t|�D] \}
}
d|
}
|
||
<q�W|jd|d|�dS(Nt
gather_subsetRHs!configttypeRt
argument_spectsupports_check_modetallt!itmsgs"Subset must be one of [%s], got %ss, sansible_net_%st
ansible_factstwarnings(R
RtTrueRtparamstsettupdatet
VALID_SUBSETSR=tFalset	fail_jsontjointaddtdifference_updateR0tFACT_SUBSETSRRR	t	exit_json(tspecRRQRItrunable_subsetstexclude_subsetstsubsettexcludeRt	instancestkeytinstRPtvalue((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pytmain�sT		
		



	

		


	
t__main__(t
__future__RRRRJt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR#tansible.module_utils.basicRtansible.module_utils.sixR	t*ansible.module_utils.network.edgeos.edgeosR
tobjectRRR'R6R
R\RtkeysRVRgR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/edgeos/edgeos_facts.pyt<module>s.


#
!!;		?

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