Anons79 Mini Shell

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

�
�Udac@s"idd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZd	dlmZm	Z	d	d
l
mZd	dlm
Z
d	dlmZd	dlmZd
ad�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zedkre�nd
S(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys�
---
module: nxos_system
extends_documentation_fragment: nxos
version_added: "2.3"
author: "Peter Sprygada (@privateip)"
short_description: Manage the system attributes on Cisco NXOS devices
description:
  - This module provides declarative management of node system attributes
    on Cisco NXOS devices.  It provides an option to configure host system
    parameters or remove those parameters from the device active
    configuration.
options:
  hostname:
    description:
      - Configure the device hostname parameter. This option takes an ASCII string value
        or keyword 'default'
  domain_name:
    description:
      - Configures the default domain
        name suffix to be used when referencing this node by its
        FQDN.  This argument accepts either a list of domain names or
        a list of dicts that configure the domain name and VRF name or
        keyword 'default'. See examples.
  domain_lookup:
    description:
      - Enables or disables the DNS
        lookup feature in Cisco NXOS.  This argument accepts boolean
        values.  When enabled, the system will try to resolve hostnames
        using DNS and when disabled, hostnames will not be resolved.
    type: bool
  domain_search:
    description:
      - Configures a list of domain
        name suffixes to search when performing DNS name resolution.
        This argument accepts either a list of domain names or
        a list of dicts that configure the domain name and VRF name or
        keyword 'default'. See examples.
  name_servers:
    description:
      - List of DNS name servers by IP address to use to perform name resolution
        lookups.  This argument accepts either a list of DNS servers or
        a list of hashes that configure the name server and VRF name or
        keyword 'default'. See examples.
  system_mtu:
    description:
      - Specifies the mtu, must be an integer or keyword 'default'.
  state:
    description:
      - State of the configuration
        values in the device's current active configuration.  When set
        to I(present), the values should be configured in the device active
        configuration and when set to I(absent) the values should not be
        in the device active configuration
    default: present
    choices: ['present', 'absent']
s�
- name: configure hostname and domain-name
  nxos_system:
    hostname: nxos01
    domain_name: test.example.com

- name: remove configuration
  nxos_system:
    state: absent

- name: configure name servers
  nxos_system:
    name_servers:
      - 8.8.8.8
      - 8.8.4.4

- name: configure name servers with VRF support
  nxos_system:
    name_servers:
      - { server: 8.8.8.8, vrf: mgmt }
      - { server: 8.8.4.4, vrf: mgmt }
s�
commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  type: list
  sample:
    - hostname nxos01
    - ip domain-name test.example.com
i����N(t
get_configtload_config(tnxos_argument_spect
check_args(t
AnsibleModule(t	iteritems(t
NetworkConfig(tComplexListcCs>tdk	r|tkSt|�}tjd|�a|tkS(Nsvrf context (\S+)(t_CONFIGURED_VRFStNoneRtretfindall(tmoduletvrftconfig((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pythas_vrf~s

c
s%t�}�jd}��fd�}d�}dd��d��fd�}|dkr:�drx|jd�nx4�d	D](}d
|d}	�|	||d�q�Wx4�d
D](}d|d}	�|	||d�q�Wx4�dD](}d|d}	�|	||d�q�W�dr:|jd�q:n|dkr!|d�r��ddkr�dr�|jd�q�q�|jd�d�n�jd�dk	r�jd��jd�krd}	�dtkr�d|	}	n|j|	�qn�d	r��jd	�dddkrn�d	r�x7�d	D](}d
|d}	�|	||d�q<Wq�q�x<|��d	�D](}d
|d}	�|	||d�q�Wx?|��d	�D](}d|d}	||	||d�q�Wn�d
r��jd
�dddkr]�d
r�x7�d
D](}d|d}	�|	||d�q+Wq�q�x<|��d
�D](}d|d}	�|	||d�qpWx?|��d
�D](}d|d}	||	||d�q�Wn�dr��jd�dddkrL�dr�x7�dD](}d|d}	�|	||d�qWq�q�x<|��d�D](}d|d}	�|	||d�q_Wx?|��d�D](}d|d}	||	||d�q�Wn|d�r!�ddkr�dr|jd�qq|jd�d�q!n|S(Ntstatecs+�j|�o*�j|��j|�kS(N(tget(tx(thavetwant(sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytneeds_update�scSs+g||D]}|||kr|^qS(N((Rtytztitem((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pyt
difference�scSsA|r|jd|�n|j|�|r=|jd�ndS(Nsvrf context %stexit(tappend(tcmdtcommandsR((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytremove�s

cs?|r/t�|�s/�jdd|�q/n�|||�S(Ntmsgsinvalid vrf name %s(Rt	fail_json(R!R"R(RR#(sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytadd�stabsentthostnamesno hostnametdomain_namesno ip domain-name %stnameRt
domain_searchsno ip domain-list %stname_serverssno ip name-server %stservert
system_mtusno system jumbomtutpresenttdefaultshostname %st
domain_lookupsip domain-lookupsno %sisip domain-name %ssip domain-list %ssip name-server %sssystem jumbomtu %s(tlisttparamsRR RtFalse(
RRRR"RRRR&RR!((RRR#RsL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytmap_obj_to_commands�s�	
	










cCs/tjd|tj�}|r+|jd�SdS(Ns^hostname (\S+)i(RtsearchtMtgroup(Rtmatch((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytparse_hostname�scCs�t�}tjd�}|j|tj�}|rZ|ji|jd�d6dd6�nx\t|�D]N\}}|j|tj�}|rg|ji|jd�d6|d6�qgqgW|S(Nsip domain-name (\S+)iR*R(	R2RtcompileR6R7R R8RR
(Rt
vrf_configtobjectstregexR9Rtcfg((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytparse_domain_name�s	'+cCs�t�}x;tjd|tj�D]!}|ji|d6dd6�q"WxXt|�D]J\}}x;tjd|tj�D]!}|ji|d6|d6�qyWqTW|S(Ns^ip domain-list (\S+)R*Rsip domain-list (\S+)(R2RRR7R RR
(RR<R=RRR?((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytparse_domain_search
s	#c	Cs�t�}tjd|tj�}|r}d|jd�kr}x>|jd�jd�D]!}|ji|d6dd6�qUWnxyt|�D]k\}}tjd|tj�}|r�x>|jd�jd�D]!}|ji|d6|d6�q�Wq�q�W|S(Ns^ip name-server (.+)$suse-vrfit R-Rsip name-server (.+)(	R2RR6R7R8tsplitR RR
(	RR<tvrfsR=R9taddrRR?t	vrf_match((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytparse_name_serverss	"&cCs/tjd|tj�}|r+|jd�SdS(Ns^system jumbomtu (\d+)i(RR6R7R8(RR9((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytparse_system_mtu(scCs�t|�}tddd|�}i}tjd|tj�}x1|D])}|jdd|g�}|||<qFWit|�d6d|kd	6t||�d
6t||�d6t	|||�d6t
|�d
6S(Ntindentitcontentss^vrf context (\S+)$tpathsvrf context %sR(sno ip domain-lookupR1R)R+R,R.(RRRRR7tget_block_configR:R@RARGRH(RRt	configobjR<RDRtconfig_data((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytmap_config_to_obj.s


cCsi|jdd6|jdd6|jdd6}ttdtdt�dt��|�}ttdtdt�dt��|�}ttdtdt�dt��|�}xfd|fd	|fd
|fgD]C\}}|j|dk	r	||j|�||<q�d||<q�W|S(NR(R1R.R*tkeyRR-R)R+R,(R3RtdicttTrueR(RtobjR)R+R,targtcast((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytmap_params_to_objCs,									cCsAtdt�dtdd�dtdd�dtdd�dtdd�d	tdd
�dtdd
dd
dg��}|jt�td|dt�}t�}t||�itd6}|r�||d<nt|�}t	|�}t
|||�}||d<|r0|js#t||�nt|d<n|j
|�dS(s+ main entry point for module execution
    R(R1ttypetboolR)R2R+R,R.tstrRR0R/tchoicesR't
argument_spectsupports_check_modetchangedtwarningsR"N(RQtupdateRR	RRR2RR4RVROR5t
check_modeRt	exit_json(R[RR^tresultRRR"((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pytmaincs2	
		



	
t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRt&ansible.module_utils.network.nxos.nxosRRRRtansible.module_utils.basicR	tansible.module_utils.sixR
t*ansible.module_utils.network.common.configRt)ansible.module_utils.network.common.utilsRRR
RR5R:R@RARGRHRORVRct__name__(((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_system.pyt<module>s2


;
			m			
				 	.

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