
    Vh                     v    d dl mZmZmZ eZdZdZd dlm	Z	m
Z
 d dlmZ  G d de      Zd Zed	k(  r e        y
y
)    )absolute_importdivisionprint_functiona  
module: hponcfg
author: Dag Wieers (@dagwieers)
short_description: Configure HP iLO interface using C(hponcfg)
description:
  - This modules configures the HP iLO interface using C(hponcfg).
extends_documentation_fragment:
  - community.general.attributes
attributes:
  check_mode:
    support: none
  diff_mode:
    support: none
options:
  path:
    description:
      - The XML file as accepted by C(hponcfg).
    required: true
    aliases: ['src']
    type: path
  minfw:
    description:
      - The minimum firmware level needed.
    required: false
    type: str
  executable:
    description:
      - Path to the hponcfg executable (C(hponcfg) which uses E(PATH)).
    default: hponcfg
    type: str
  verbose:
    description:
      - Run C(hponcfg) in verbose mode (-v).
    default: false
    type: bool
requirements:
  - hponcfg tool
notes:
  - You need a working C(hponcfg) on the target system.
a+  
- name: Example hponcfg configuration XML
  ansible.builtin.copy:
    content: |
      <ribcl VERSION="2.0">
        <login USER_LOGIN="user" PASSWORD="password">
          <rib_info MODE="WRITE">
            <mod_global_settings>
              <session_timeout value="0"/>
              <ssh_status value="Y"/>
              <ssh_port value="22"/>
              <serial_cli_status value="3"/>
              <serial_cli_speed value="5"/>
            </mod_global_settings>
          </rib_info>
        </login>
      </ribcl>
    dest: /tmp/enable-ssh.xml

- name: Configure HP iLO using enable-ssh.xml
  community.general.hponcfg:
    src: /tmp/enable-ssh.xml

- name: Configure HP iLO on VMware ESXi hypervisor
  community.general.hponcfg:
    src: /tmp/enable-ssh.xml
    executable: /opt/hp/tools/hponcfg
)	CmdRunnercmd_runner_fmt)ModuleHelperc                       e Zd Z e e edddg       ed       edd       edd	      
            Z e ej                  d       ej                  d       ej                  d            ZdZ	d Z
y)HPOnCfgpathT)typerequiredaliasesstr)r   hponcfg)defaultr   Fbool)srcminfw
executableverbose)argument_specz-fz-vz-mr   r   r   c                     t        | j                  | j                  j                  | j                  d      } |g d      j                          d| _        y )NT)check_rcr   )r   modulevarsr   command_args_formatsrunchanged)selfrunners     m/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/general/plugins/modules/hponcfg.py__run__zHPOnCfg.__run__f   sI    KKII  %%	
 	*+//1     N)__name__
__module____qualname__dictr   r   
as_opt_valas_boolr   use_old_vardictr#    r$   r"   r
   r
   V   s    &4&BE"IE:V4	
F  %N%%d+&&&t,'n''-
 O
r$   r
   c                  ,    t         j                          y )N)r
   executer,   r$   r"   mainr/   s   s    OOr$   __main__N)
__future__r   r   r   r   __metaclass__DOCUMENTATIONEXAMPLESEansible_collections.community.general.plugins.module_utils.cmd_runnerr   r   Hansible_collections.community.general.plugins.module_utils.module_helperr   r
   r/   r%   r,   r$   r"   <module>r7      sP    A @'R: l al : zF r$   