�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l m Z d d
l
m Z d d l j j Z d d l m Z d d l Z e j � Z d e f d � � YZ d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Update ONTAP software
- Requires an https connection and is not supported over http
extends_documentation_fragment:
- netapp.na_ontap
module: na_ontap_software_update
options:
state:
choices: ['present', 'absent']
description:
- Whether the specified ONTAP package should update or not.
default: present
nodes:
description:
- List of nodes to be updated, the nodes have to be a part of a HA Pair.
aliases:
- node
package_version:
required: true
description:
- Specifies the package version to update software.
package_url:
required: true
description:
- Specifies the package URL to download the package.
ignore_validation_warning:
description:
- Allows the update to continue if warnings are encountered during the validation phase.
default: False
type: bool
short_description: NetApp ONTAP Update Software
version_added: "2.7"
se
- name: ONTAP software update
na_ontap_software_update:
state: present
nodes: vsim1
package_url: "{{ url }}"
package_version: "{{ version_name }}"
ignore_validation_warning: True
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
t
N( t
AnsibleModule( t to_native( t NetAppModulet NetAppONTAPSoftwareUpdatec B` sq e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z
d � Z d
� Z d � Z
RS( s2
Class with ONTAP software update methods
c C` s, t j � | _ | j j t d t d t d d d d d g d d � d t d t d d
d d g � d
t d t d d � d t d t d d � d t d t d d d t � � � t d | j d t � | _ t � | _
| j
j | j j � | _
t t k r| j j d d � n t j d | j � | _ d S( Nt statet requiredt typet strt choicest presentt absentt defaultt nodest listt aliasest nodet package_versiont package_urlt ignore_validation_warningt boolt
argument_spect supports_check_modet msgs( the python NetApp-Lib module is requiredt module( t netapp_utilst na_ontap_host_argument_specR t updatet dictt Falset TrueR R R t na_helpert set_parameterst paramst
parameterst HAS_NETAPP_LIBt fail_jsont setup_na_ontap_zapit server( t self( ( s[ /usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_software_update.pyt __init__Q s ' c C` sT t j j d � } t j j d � } t j j d � } | j | � | j | � | S( s�
Compose NaElement object to query current version
:return: NaElement object for cluster-image-get-iter with query
s cluster-image-get-itert querys cluster-image-info( R! t zapit NaElementt add_child_elem( R/ t cluster_image_getR1 t cluster_image_info( ( s[ /usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_software_update.pyt cluster_image_get_iterh s
c C` s� | j � } y | j j | d t �} WnO t j j k
ry } | j j d d | j d t
| � f d t j � � n X| j
d � r� t | j d � � d k r� t Sd S( sl
Get current cluster image info
:return: True if query successful, else return None
t enable_tunnelingR s, Error fetching cluster image details: %s: %sR t exceptions num-recordsi N( R7 R. t invoke_successfullyR&