�
�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
m Z d d l m
Z
y* d d
l m Z d d l m Z e Z Wn e k
r� e Z n Xd � Z d � Z 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�
---
module: idrac_firmware
short_description: Firmware update from a repository on a network share (CIFS, NFS).
version_added: "2.8"
description:
- Update the Firmware by connecting to a network share (either CIFS or NFS) that contains a catalog of
available updates.
- Network share should contain a valid repository of Update Packages (DUPs) and a catalog file describing the DUPs.
- All applicable updates contained in the repository are applied to the system.
- This feature is available only with iDRAC Enterprise License.
options:
idrac_ip:
description: iDRAC IP Address.
type: str
required: True
idrac_user:
description: iDRAC username.
type: str
required: True
idrac_password:
description: iDRAC user password.
type: str
required: True
aliases: ['idrac_pwd']
idrac_port:
description: iDRAC port.
type: int
default: 443
share_name:
description: CIFS or NFS Network share.
type: str
required: True
share_user:
description: Network share user in the format 'user@domain' or 'domain\\user' if user is
part of a domain else 'user'. This option is mandatory for CIFS Network Share.
type: str
share_password:
description: Network share user password. This option is mandatory for CIFS Network Share.
type: str
aliases: ['share_pwd']
share_mnt:
description: Local mount path of the network share with read-write permission for ansible user.
This option is mandatory for Network Share.
type: str
required: True
reboot:
description: Whether to reboots after applying the updates or not.
type: bool
default: false
job_wait:
description: Whether to wait for job completion or not.
type: bool
default: true
catalog_file_name:
required: False
description: Catalog file name relative to the I(share_name).
type: str
default: 'Catalog.xml'
requirements:
- "omsdk"
- "python >= 2.7.5"
author: "Rajeev Arakkal (@rajeevarakkal)"
s�
---
- name: Update firmware from repository on a Network Share
idrac_firmware:
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
share_name: "192.168.0.0:/share"
share_user: "share_user_name"
share_password: "share_user_pwd"
share_mnt: "/mnt/share"
reboot: True
job_wait: True
catalog_file_name: "Catalog.xml"
s
---
msg:
type: str
description: Over all firmware update status.
returned: always
sample: "Successfully updated the firmware."
update_status:
type: dict
description: Firmware Update job and progress details from the iDRAC.
returned: success
sample: {
'InstanceID': 'JID_XXXXXXXXXXXX',
'JobState': 'Completed',
'Message': 'Job completed successfully.',
'MessageId': 'REDXXX',
'Name': 'Repository Update',
'JobStartTime': 'NA',
'Status': 'Success',
}
( t iDRACConnection( t
AnsibleModule( t UserCredentials( t FileOnSharec C` sC | j � } | s! t d � � n | j d � s? t d � � n d S( Ns/ catalog_file_name should be a non-empty string.t xmls( catalog_file_name should be an XML file.( t lowert
ValueErrort endswith( t catalog_file_namet normilized_file_name( ( s\ /usr/lib/python2.7/site-packages/ansible/modules/remote_management/dellemc/idrac_firmware.pyt _validate_catalog_file� s
c C` sg i } t | d <i | d <y� t d | j d d | j d d | j d d t d
t | j d | j d � � } t | _ d
| j k s� d | j k r� t | _ n t } | j j | | | j d | j d � | d <Wn) t k
r} | j
d t | � � n Xd | d k rc| d d d k rF| j d r`t | d <q`qc| j
d d d | d � n | S( s@ Update firmware from a network share and return the job details.t changedt
update_statust remotet
share_namet /R t mount_pointt share_mntt isFoldert credst
share_usert share_passwordt 12t 13t reboott job_waitt msgt Statust Successs Failed to update firmware.( t FalseR t paramsR
t Truet use_redfisht ServerGenerationt
update_mgrt update_from_repot RuntimeErrort fail_jsont str( t idract moduleR"