Anons79 Mini Shell

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

�
�Udac@`s&ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZddlmZmZddlmZmZmZddlmZmZdddddgZd�Zd�Zd�Zd�Zd�Ze dkr"e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysQ
---
module: ftd_install
short_description: Installs FTD pkg image on the firewall
description:
  - Provisioning module for FTD devices that installs ROMMON image (if needed) and
    FTD pkg image on the firewall.
  - Can be used with `httpapi` and `local` connection types. The `httpapi` is preferred,
    the `local` connection should be used only when the device cannot be accessed via
    REST API.
version_added: "2.8"
requirements: [ "python >= 3.5", "firepower-kickstart" ]
notes:
  - Requires `firepower-kickstart` library that should be installed separately and requires Python >= 3.5.
  - On localhost, Ansible can be still run with Python >= 2.7, but the interpreter for this particular module must be
    Python >= 3.5.
  - Python interpreter for the module can overwritten in `ansible_python_interpreter` variable.
author: "Cisco Systems, Inc. (@annikulin)"
options:
  device_hostname:
    description:
      - Hostname of the device as appears in the prompt (e.g., 'firepower-5516').
    required: true
    type: str
  device_username:
    description:
      - Username to login on the device.
      - Defaulted to 'admin' if not specified.
    required: false
    type: str
    default: admin
  device_password:
    description:
      - Password to login on the device.
    required: true
    type: str
  device_sudo_password:
    description:
      - Root password for the device. If not specified, `device_password` is used.
    required: false
    type: str
  device_new_password:
    description:
      - New device password to set after image installation.
      - If not specified, current password from `device_password` property is reused.
      - Not applicable for ASA5500-X series devices.
    required: false
    type: str
  device_ip:
    description:
      - Device IP address of management interface.
      - If not specified and connection is 'httpapi`, the module tries to fetch the existing value via REST API.
      - For 'local' connection type, this parameter is mandatory.
    required: false
    type: str
  device_gateway:
    description:
      - Device gateway of management interface.
      - If not specified and connection is 'httpapi`, the module tries to fetch the existing value via REST API.
      - For 'local' connection type, this parameter is mandatory.
    required: false
    type: str
  device_netmask:
    description:
      - Device netmask of management interface.
      - If not specified and connection is 'httpapi`, the module tries to fetch the existing value via REST API.
      - For 'local' connection type, this parameter is mandatory.
    required: false
    type: str
  device_model:
    description:
      - Platform model of the device (e.g., 'Cisco ASA5506-X Threat Defense').
      - If not specified and connection is 'httpapi`, the module tries to fetch the device model via REST API.
      - For 'local' connection type, this parameter is mandatory.
    required: false
    type: str
    choices:
      - Cisco ASA5506-X Threat Defense
      - Cisco ASA5508-X Threat Defense
      - Cisco ASA5516-X Threat Defense
      - Cisco Firepower 2110 Threat Defense
      - Cisco Firepower 2120 Threat Defense
      - Cisco Firepower 2130 Threat Defense
      - Cisco Firepower 2140 Threat Defense
  dns_server:
    description:
      - DNS IP address of management interface.
      - If not specified and connection is 'httpapi`, the module tries to fetch the existing value via REST API.
      - For 'local' connection type, this parameter is mandatory.
    required: false
    type: str
  console_ip:
    description:
      - IP address of a terminal server.
      - Used to set up an SSH connection with device's console port through the terminal server.
    required: true
    type: str
  console_port:
    description:
      - Device's port on a terminal server.
    required: true
    type: str
  console_username:
    description:
      - Username to login on a terminal server.
    required: true
    type: str
  console_password:
    description:
      - Password to login on a terminal server.
    required: true
    type: str
  rommon_file_location:
    description:
      - Path to the boot (ROMMON) image on TFTP server.
      - Only TFTP is supported.
    required: true
    type: str
  image_file_location:
    description:
      - Path to the FTD pkg image on the server to be downloaded.
      - FTP, SCP, SFTP, TFTP, or HTTP protocols are usually supported, but may depend on the device model.
    required: true
    type: str
  image_version:
    description:
      - Version of FTD image to be installed.
      - Helps to compare target and current FTD versions to prevent unnecessary reinstalls.
    required: true
    type: str
  force_install:
    description:
      - Forces the FTD image to be installed even when the same version is already installed on the firewall.
      - By default, the module stops execution when the target version is installed in the device.
    required: false
    type: bool
    default: false
  search_domains:
    description:
      - Search domains delimited by comma.
      - Defaulted to 'cisco.com' if not specified.
    required: false
    type: str
    default: cisco.com
s7
  - name: Install image v6.3.0 on FTD 5516
    ftd_install:
      device_hostname: firepower
      device_password: pass
      device_ip: 192.168.0.1
      device_netmask: 255.255.255.0
      device_gateway: 192.168.0.254
      dns_server: 8.8.8.8

      console_ip: 10.89.0.0
      console_port: 2004
      console_username: console_user
      console_password: console_pass

      rommon_file_location: 'tftp://10.89.0.11/installers/ftd-boot-9.10.1.3.lfbff'
      image_file_location: 'https://10.89.0.11/installers/ftd-6.3.0-83.pkg'
      image_version: 6.3.0-83
s�
msg:
    description: The message saying whether the image was installed or explaining why the installation failed.
    returned: always
    type: str
(t
AnsibleModule(t
Connection(t	iteritems(tBaseConfigurationResourcet	ParamName(tassert_kick_is_installedtFtdPlatformFactorytFtdModel(t
FtdOperationstget_system_infot	device_iptdevice_netmasktdevice_gatewaytdevice_modelt
dns_serverc-C`s�tdtdddt�dtdddtdd�dtdddtd	t�d
tdddtd	t�dtdddtd	t�dtdddt�d
tdddt�dtdddt�dtdddtdtj��dtdddt�dtdddtdd�dtdddt�dtdddt�dtdddt�dtdddtd	t�dtdddt�dtdddt�dtdddt�dtdddtdt��}td|�}t|�|jdk}|r)t	||j
�|j
d}t||�nnt|j�}t
||j�}t|�}|j
dpj|d}t||�t||�t||j
�tj||j
�}|j|j
�|jdtd d!|j
d�dS("Ntdevice_hostnamettypetstrtrequiredtdevice_usernametdefaulttadmintdevice_passwordtno_logtdevice_sudo_passwordtdevice_new_passwordRRRRtchoicesRtsearch_domainss	cisco.comt
console_iptconsole_porttconsole_usernametconsole_passwordtrommon_file_locationtimage_file_locationt
image_versiont
force_installtboolt
argument_spect
platformModeltchangedtmsgs;Successfully installed FTD image %s on the firewall device.(tdicttTruetFalseRtsupported_modelsRR
t_socket_pathtNonet*check_required_params_for_local_connectiontparamstcheck_that_model_is_supportedR	Rt
check_modeRtcheck_that_update_is_neededtcheck_management_and_dns_paramsRtcreatetinstall_ftd_imaget	exit_json(tfieldstmoduletuse_local_connectiontplatform_modelt
connectiontresourcetsystem_infotftd_platform((sK/usr/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_install.pytmain�sL!



cC`ssgt|�D]*\}}|tkr
|dkr
|^q
}|roddjt|��}|jd|�ndS(Ns[The following parameters are mandatory when the module is used with 'local' connection: %s.s, R0(R
t$REQUIRED_PARAMS_FOR_LOCAL_CONNECTIONR6tjointsortedt	fail_json(RAR8tktvtmissing_paramstmessage((sK/usr/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_install.pyR7s
=cC`s-|tj�kr)|jdd|�ndS(NR0s4Platform model '%s' is not supported by this module.(RR4RL(RARC((sK/usr/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_install.pyR9
scC`sL|jd}|jdrH||dkrH|jdtdd|�ndS(NR*R+tsoftwareVersionR/R0s1FTD already has %s version of software installed.(R8R?R3(RARFttarget_ftd_version((sK/usr/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_install.pyR;s
c	C`st|d|d|dg�s�|jtji�dd}|dpO|d|d<|dpg|d|d<|dp|d|d<n|d	s�|jtji�dd}|d
d}|jtjii|d6tj6�}|d
dd|d	<ndS(NRRRtitemsitipv4Addresstipv4NetMasktipv4GatewayRtdnsServerGrouptidtobjIdt
dnsServerst	ipAddress(talltexecute_operationRtGET_MANAGEMENT_IP_LISTtGET_DNS_SETTING_LISTtGET_DNS_SERVER_GROUPRtPATH_PARAMS(RER8t
management_iptdns_settingtdns_server_group_idtdns_server_group((sK/usr/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_install.pyR<s!
t__main__N(!t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.connectionR	tansible.module_utils.sixR
t.ansible.module_utils.network.ftd.configurationRRt'ansible.module_utils.network.ftd.deviceR
RRt*ansible.module_utils.network.ftd.operationRRRIRHR7R9R;R<t__name__(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_install.pyt<module>s*


�	1				

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