Anons79 Mini Shell

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

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	m
Z
ddlmZm
Z
ddlmZy:dd
lmZddlmZddlmZeZWnek
r�eZnXd�Zd�Zd�Zedkre�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys0

---
module: junos_package
version_added: "2.1"
author: "Peter Sprygada (@privateip)"
short_description: Installs packages on remote devices running Junos
description:
  - This module can install new and updated packages on remote
    devices running Junos.  The module will compare the specified
    package with the one running on the remote device and install
    the specified version if there is a mismatch
extends_documentation_fragment: junos
options:
  src:
    description:
      - The I(src) argument specifies the path to the source package to be
        installed on the remote device in the advent of a version mismatch.
        The I(src) argument can be either a localized path or a full
        path to the package file to install.
    required: true
    aliases: ['package']
  version:
    description:
      - The I(version) argument can be used to explicitly specify the
        version of the package that should be installed on the remote
        device.  If the I(version) argument is not specified, then
        the version is extracts from the I(src) filename.
  reboot:
    description:
      - In order for a package to take effect, the remote device must be
        restarted.  When enabled, this argument will instruct the module
        to reboot the device once the updated package has been installed.
        If disabled or the remote package does not need to be changed,
        the device will not be started.
    type: bool
    default: 'yes'
  no_copy:
    description:
      - The I(no_copy) argument is responsible for instructing the remote
        device on where to install the package from.  When enabled, the
        package is transferred to the remote device prior to installing.
    type: bool
    default: 'no'
  validate:
    description:
      - The I(validate) argument is responsible for instructing the remote
        device to skip checking the current device configuration
        compatibility with the package being installed. When set to false
        validation is not performed.
    version_added: 2.5
    type: bool
    default: 'yes'
  force:
    description:
      - The I(force) argument instructs the module to bypass the package
        version check and install the packaged identified in I(src) on
        the remote device.
    type: bool
    default: 'no'
  force_host:
    description:
      - The I(force_host) argument controls the way software package or
        bundle is added on remote JUNOS host and is applicable
        for JUNOS QFX5100 device. If the value is set to C(True) it
        will ignore any warnings while adding the host software package or bundle.
    type: bool
    default: False
    version_added: 2.8
  issu:
    description:
      - The I(issu) argument is a boolean flag when set to C(True) allows
        unified in-service software upgrade (ISSU) feature which enables
        you to upgrade between two different Junos OS releases with no
        disruption on the control plane and with minimal disruption of traffic.
    type: bool
    default: False
    version_added: 2.8
requirements:
  - junos-eznc
  - ncclient (>=v0.5.2)
notes:
  - This module requires the netconf system service be enabled on
    the remote device being managed.
  - Tested against vSRX JUNOS version 15.1X49-D15.4, vqfx-10000 JUNOS Version 15.1X53-D60.4.
  - Works with C(local) connections only.
se
# the required set of connection arguments have been purposely left off
# the examples for brevity

- name: install local package on remote device
  junos_package:
    src: junos-vsrx-12.1X46-D10.2-domestic.tgz

- name: install local package on remote device without rebooting
  junos_package:
    src: junos-vsrx-12.1X46-D10.2-domestic.tgz
    reboot: no
(t
AnsibleModule(tjunos_argument_spect	get_param(t	to_native(tDevice(tSW(tConnectErrorcC`s�t|d�}it|d�p$dd6t|d�d6}t|d�r`t|d�|d<nt|d�r�t|d�|d	<nt|d
<y5t||�}|j�t|d�p�d|_Wn3tk
r�}|jd
d|t|�f�nX|S(Nthosttporti>tusernametusertpasswordtpasswdtssh_keyfiletssh_private_key_filetgather_factsttimeouti
tmsgsunable to connect to %s: %s(R
tFalseRtopenRRt	fail_jsonR(tmoduleRtkwargstdevicetexc((sO/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_package.pytconnect�s 

$c
`s�t|�}�jd}�jd}�jd}�jd}�jd}�fd�}�jd�|j|d|d|d|d|d|�}	|	s��jd	d
�n�jdr��jd�|j�ndS(
Ntsrctno_copytvalidatet
force_hosttissuc`s�j|�dS(N(tlog(tdevtreport(R(sO/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_package.pytprogress_log�ssinstalling packagetprogressRs#Unable to install package on devicetrebootsrebooting system(R
tparamsR'tinstallRR,(
RRtjunostpackageR#R$R%R&R*tresult((RsO/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_package.pytinstall_package�s







cC`s�tdtdddtddg�dt�dtdd	d
t�dtd
tdd	�dtd
tdd	�d
tdd	d
t�dtd
dddg�dtdd	d
t�dtdd	d
t��	}|jt�td|dt�}|jddkri|jd<nts$|j	dd�ntdt�}|jd
pCt}t
|�}|jd
s�|j�|jj
d�}|jd}||k}n|r�|js�t||�nt|d<n|j|�dS(s3 Main entry point for Ansible module execution
    R"ttypetpathtrequiredtaliasesR0tversionR,tbooltdefaultR#R$tforcet	transporttnetconftchoicesR%R&t
argument_spectsupports_check_modetproviderRsojunos-eznc is required but does not appear to be installed. It can be installed using `pip  install junos-eznc`tchangedN(tdicttTrueRtupdateR	RR-tNonetHAS_PYEZRR!t
facts_refreshtfactstgett
check_modeR2t	exit_json(R>RR1t
do_upgradeRthas_vert	wants_ver((sO/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_package.pytmain�s>	
		



	
t__main__N(t
__future__RRRR3t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStansible.module_utils.basicRt(ansible.module_utils.network.junos.junosR	R
tansible.module_utils._textRt
jnpr.junosRtjnpr.junos.utils.swR
tjnpr.junos.exceptionRRCRFtImportErrorRR!R2ROt__name__(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_package.pyt<module>s*


X


			1

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