
    Vh]                     z    d dl mZmZmZ eZdZdZdZd dl	m
Z
 d dlmZmZ  G d de      Zd	 Zed
k(  r e        yy)    )absolute_importdivisionprint_functiona  
---
module: edit_bios
version_added: "1.0.0"
author:
    - WangBaoshan (@ieisystem)
short_description: Set BIOS setup attributes
description:
   - Set BIOS setup attributes on ieisystem Server.
notes:
   - Does not support C(check_mode).
options:
    list:
        description:
            - Show attribute name and configurable value.
        default: False
        type: bool
    attribute:
        description:
            - BIOS setup option.
            - Required when I(list=False) and I(file_url=None).
        type: str
    value:
        description:
            - BIOS setup option value.
            - Required when I(list=False) and I(file_url=None).
        type: str
    file_url:
        description:
            - BIOS option file. attribute must be used with value.
            - Mutually exclusive with fileurl format, "/directory/filename".
        type: str
extends_documentation_fragment:
    - ieisystem.inmanage.inmanage
a  
- name: Bios test
  hosts: inmanage
  connection: local
  gather_facts: false
  vars:
    inmanage:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Set bios setup"
    ieisystem.inmanage.edit_bios:
      attribute: "VMX"
      value: "Disable"
      provider: "{{ inmanage }}"

  - name: "Set bios setup"
    ieisystem.inmanage.edit_bios:
      attribute: "VMX"
      value: "Enable"
      provider: "{{ inmanage }}"
a1  
message:
    description: Messages returned after module execution.
    returned: always
    type: str
state:
    description: Status after module execution.
    returned: always
    type: str
changed:
    description: Check to see if a change was made on the device.
    returned: always
    type: bool
)AnsibleModule)inmanage_argument_specget_connectionc                   *    e Zd Zd Zd Zd Zd Zd Zy)BIOSc                 ^    || _         d | _        | j                          t               | _        y )N)specmoduleinit_moduledictresults)selfargument_specs     p/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/ieisystem/inmanage/plugins/modules/edit_bios.py__init__zBIOS.__init__]   s%    !	v    c                 <    t        | j                  d      | _        y)zInit module objectF)r   supports_check_modeN)r   r   r   r   s    r   r   zBIOS.init_modulec   s     $))@r   c                     d| j                   j                  d<   t        | j                         | _        | j                  d   dk(  rd| j                  d<   y y )Nsetbios
subcommandStateSuccessTchanged)r   paramsr   r   r   s    r   run_commandzBIOS.run_commandi   sJ    +4<(%dkk2<< I-&*DLL# .r   c                 P     | j                   j                  di | j                   y)zShow resultN )r   	exit_jsonr   r   s    r   show_resultzBIOS.show_resulto   s    --r   c                 D    | j                          | j                          y)WorkerN)r    r$   r   s    r   workz	BIOS.works   s    r   N)__name__
__module____qualname__r   r   r    r$   r'   r"   r   r   r
   r
   \   s    @+.r   r
   c            	          t        t        ddd      t        dd      t        dd      t        dd            } | j                  t               t        |       }|j	                          y )NboolF)typerequireddefaultstr)r-   r.   )list	attributevaluefile_url)r   updater   r
   r'   )r   bios_objs     r   mainr7   y   sZ    vu=EE2.551	M /0M"HMMOr   __main__N)
__future__r   r   r   r-   __metaclass__DOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   Dansible_collections.ieisystem.inmanage.plugins.module_utils.inmanager   r   objectr
   r7   r(   r"   r   r   <module>rA      sV    C B"H4
 5 y6 :	 zF r   