Anons79 Mini Shell

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

�
�Udac@`s6ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZddlmZdefd��YZdefd��YZdefd��YZedede�Zeej��Zd�Zedkr2e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: ordnance_facts
version_added: "2.3"
author: "Alexander Turner (@alexanderturner) <[email protected]>"
short_description: Collect facts from Ordnance Virtual Routers over SSH
description:
  - Collects a base set of device facts from an Ordnance Virtual
    router over SSH. This module prepends all of the
    base network fact keys with C(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.
options:
  gather_subset:
    description:
      - When supplied, this argument will restrict the facts collected
        to a given subset.  Possible values for this argument include
        all, hardware, config, and interfaces.  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'
sH
---
# Note: examples below use the following provider dict to handle
#       transport and authentication to the node.
vars:
  cli:
    host: "{{ inventory_hostname }}"
    username: RouterName
    password: ordnance
    transport: cli

---
# Collect all facts from the device
- ordnance_facts:
    gather_subset: all
    provider: "{{ cli }}"

# Collect only the config and default facts
- ordnance_facts:
    gather_subset:
      - config
    provider: "{{ cli }}"

# Do not collect hardware facts
- ordnance_facts:
    gather_subset:
      - "!hardware"
    provider: "{{ cli }}"
s�
ansible_net_gather_subset:
  description: The list of fact subsets collected from the virtual router
  returned: always
  type: list

# config
ansible_net_config:
  description: The current active config from the virtual router
  returned: when config is configured
  type: str

# interfaces
ansible_net_all_ipv4_addresses:
  description: All IPv4 addresses configured on the virtual router
  returned: when interfaces is configured
  type: list
ansible_net_all_ipv6_addresses:
  description: All IPv6 addresses configured on the virtual router
  returned: when interfaces is configured
  type: list
ansible_net_interfaces:
  description: A hash of all interfaces running on the virtual router
  returned: when interfaces is configured
  type: dict
N(t
NetworkModule(t	iteritems(tzip(t	to_nativet	FactsBasecB`seZd�Zd�ZRS(cC`s%||_t�|_t�|_dS(N(tmoduletdicttfactstlisttfailed_commands(tselfR
((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyt__init__ks	cC`s@y|jj|�dSWn!tk
r;|jj|�nXdS(Ni(R
tclit	ExceptionRtappend(Rtcmd((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pytrunps
(t__name__t
__module__RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyRis	tConfigcB`seZd�ZRS(cC`s)|jd�}|r%||jd<ndS(Nsshow running-configtconfig(RR(Rtdata((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pytpopulateys(RRR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyRwst
InterfacescB`sbeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
cC`s�t�|jd<t�|jd<|jd�}|r]|j|�}|j|�|jd<n|jd�}|r�|j|�}|j|�ndS(Ntall_ipv4_addressestall_ipv6_addressessshow interfacest
interfacessshow ipv6 interface(RRRtparse_interfacestpopulate_interfacestpopulate_ipv6_interfaces(RRR"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR�scC`s�t�}x�t|�D]�\}}t�}|j|�|d<|j|�|d<|j|�}|j|�|d<|r�|j|dd�n|j|�|d<|j|�|d<|j|�|d<|||<qW|S(Ntdescriptiont
macaddresstipv4taddresstduplext
operstatusttype(	RR	tparse_descriptiontparse_macaddresst
parse_ipv4tadd_ip_addresstparse_duplextparse_operstatust
parse_type(RR"RtkeytvaluetintfR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR$�s		c	C`s�x�t|�D]�\}}t�|jd|d<tjd|tj�}tjd|tj�}xpt||�D]_\}}td|j�d|j��}|j	|j�d�|jd|dj
|�qqWq
WdS(NR"tipv6s\s+(.+), subnets, subnet is (.+)$R)tsubnet(R	RRtretfindalltMR
RtstripR0R(	RRR4R5t	addressestsubnetstaddrR8R7((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR%�s!cC`s;|dkr#|jdj|�n|jdj|�dS(NR(R R!(RR(RR)tfamily((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR0�scC`s�t�}d}x�|jd�D]y}t|�dkr=qq|ddkrd||cd|7<qtjd|�}|r|jd�}|||<qqW|S(Nts
it s
%ss^(\S+)i(RtsplittlenR9tmatchtgroup(RRtparsedR4tlineRE((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR#�s	cC`s/tjd|tj�}|r+|jd�SdS(NsDescription: (.+)$i(R9tsearchR;RF(RRRE((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR-�scC`s)tjd|�}|r%|jd�SdS(Nsaddress is (\S+)i(R9RIRF(RRRE((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR.�scC`sStjd|�}|rO|jd�jd�\}}td|dt|��SdS(NsInternet address is (\S+)it/R)tmasklen(R9RIRFRCRtint(RRRER?RK((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR/�scC`s/tjd|tj�}|r+|jd�SdS(Ns(\w+) Duplexi(R9RIR;RF(RRRE((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR1�scC`s/tjd|tj�}|r+|jd�SdS(Ns^(?:.+) is (.+),i(R9RIR;RF(RRRE((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyR2�s(RRRR$R%R0R#R-R.R/R1R2(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyRs			
						R"RcC`s\tdtddgdd��}td|dt�}|jd}t�}t�}x�|D]�}|dkr�|jt�q\n|jd	�r�|d
}|dkr�|jt�q\nt}nt}|tkr�|j	dd�n|r�|j
|�q\|j
|�q\W|s$|jt�n|j|�|j
d�t�}t|�|d<t�}x%|D]}	|j
t|	|��qgWt�}
y?x8|D]0}|j�|
j|j�|j|j�q�WWn5tk
r}|j	dt|�d
tj��nXt�}
x.t|�D] \}	}d|	}	||
|	<qW|jd|
d|
�dS(Nt
gather_subsettdefaults!configR,Rt
argument_spectsupports_check_modetallt!itmsgs
Bad subsett	exceptionsansible_net_%st
ansible_factsR(RRtTruetparamstsettupdatet
VALID_SUBSETSt
startswithtFalset	fail_jsontaddtdifference_updateRRtFACT_SUBSETSRtextendRRRRt	tracebackt
format_excR	t	exit_json(tspecR
RMtrunable_subsetstexclude_subsetstsubsettexcludeRt	instancesR4RtinsttexcRUR5((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pytmain�sX
		



	

		
	

&	
t__main__(t
__future__RRRR,t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR9Rbt+ansible.module_utils.network.common.networkRtansible.module_utils.sixR	tansible.module_utils.six.movesR
tansible.module_utils._textRtobjectRRRRR`t	frozensettkeysRZRmR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/ordnance/ordnance_facts.pyt<module>s.


]		A

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