Ë
    Ç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: ad_group
version_added: "1.0.0"
author:
    - WangBaoshan (@ieisystem)
short_description: Manage active directory group information
description:
   - Manage active directory group information on ieisystem Server.
notes:
   - Does not support C(check_mode).
options:
    state:
        description:
            - Whether the active directory group should exist or not, taking action if the state is different from what is stated.
        choices: ['present', 'absent']
        default: present
        type: str
    name:
        description:
            - Enter the Role Group Name. This name identifies the role group in Active Directory.
        type: str
        required: true
    domain:
        description:
            - Enter the Role Group Domain. This is the domain where the role group is located.
        type: str
    pri:
        description:
            - Enter the Role Group Privilege. This is the level of privilege to be assigned for this role group.
        choices: ['administrator', 'user', 'operator', 'oem', 'none']
        type: str
    kvm:
        description:
            - This field provides access to KVM for AD authenticated role group user.
        choices: ['enable', 'disable']
        type: str
    vm:
        description:
            - This field provides access to VMedia for AD authenticated role group user.
        choices: ['enable', 'disable']
        type: str
extends_documentation_fragment:
    - ieisystem.inmanage.inmanage
a<  
- name: Ad group test
  hosts: inmanage
  connection: local
  gather_facts: false
  vars:
    inmanage:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Add active directory group information"
    ieisystem.inmanage.ad_group:
      state: "present"
      name: "wbs"
      domain: "test.com"
      pri: "administrator"
      kvm: "enable"
      vm: "disable"
      provider: "{{ inmanage }}"

  - name: "Set active directory group information"
    ieisystem.inmanage.ad_group:
      state: "present"
      name: "wbs"
      pri: "user"
      kvm: "disable"
      provider: "{{ inmanage }}"

  - name: "Delete active directory group information"
    ieisystem.inmanage.ad_group:
      state: "absent"
      name: "wbs"
      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)ÚADc                 ó^   — || _         d | _        | j                  «        t        «       | _        y )N)ÚspecÚmoduleÚinit_moduleÚdictÚresults)ÚselfÚargument_specs     úo/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/ieisystem/inmanage/plugins/modules/ad_group.pyÚ__init__zAD.__init__s   s%   € Ø!ˆŒ	ØˆŒØ×ÑÔÜ“vˆó    c                 ó<   — t        | j                  d¬«      | _        y)zInit module objectF)r   Úsupports_check_modeN)r   r   r   ©r   s    r   r   zAD.init_moduley   s   € ô $ØŸ)™)¸ô@ˆr   c                 ó®   — d| j                   j                  d<   t        | j                   «      | _        | j                  d   dk(  rd| j                  d<   y y )NÚeditadgroupÚ
subcommandÚStateÚSuccessTÚchanged)r   Úparamsr   r   r   s    r   Úrun_commandzAD.run_command   sJ   € Ø+8ˆ‰×Ñ˜<Ñ(Ü% d§k¡kÓ2ˆŒØ<‰<˜Ñ  IÒ-Ø&*ˆDL‰L˜Ò#ð .r   c                 óP   —  | j                   j                  di | j                  ¤Ž y)zShow resultN© )r   Ú	exit_jsonr   r   s    r   Úshow_resultzAD.show_result…   s   € àˆ‰×ÑÑ- §¡Ó-r   c                 óD   — | j                  «        | j                  «        y)ÚWorkerN)r    r$   r   s    r   ÚworkzAD.work‰   s   € à×ÑÔØ×ÑÕr   N)Ú__name__Ú
__module__Ú__qualname__r   r   r    r$   r'   r"   r   r   r
   r
   r   s   „ òò@ò+ò.ór   r
   c                  ó"  — t        t        dddgd¬«      t        dd¬«      t        dd¬«      t        ddg d¢¬	«      t        ddd
dg¬	«      t        ddd
dg¬	«      ¬«      } | j                  t        «       t        | «      }|j	                  «        y )NÚstrÚpresentÚabsent)ÚtypeÚchoicesÚdefaultT)r/   ÚrequiredF)ÚadministratorÚuserÚoperatorÚoemÚnone)r/   r2   r0   ÚenableÚdisable)ÚstateÚnameÚdomainÚpriÚkvmÚvm)r   Úupdater   r
   r'   )r   Úad_objs     r   ÚmainrB      s„   € ÜÜ˜¨	°8Ð'<ÀiÔPÜu tÔ,Ü˜¨Ô/Üe eÒ5iÔjÜe e°hÀ	Ð5JÔKÜU U°X¸yÐ4IÔJô€Mð ×ÑÔ/Ô0ÜÓ€FØ
‡KK…Mr   Ú__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
   rB   r(   r"   r   r   ú<module>rL      sW   ð÷ CÑ Bà€ð,€ð\$€ðL
€õ 5ß yôˆô ò:ð ˆzÒÙ…Fð r   