
    Vh
                     ^    d Z dZdZddlmZ ddlmZ  G d de      Zd Ze	d	k(  r e        y
y
)a  
---
module: identity_group
short_description: Manage a OpenStack identity (Keystone) group
author: OpenStack Ansible SIG
description:
  - Create, update or delete an OpenStack identity (Keystone) group.
options:
  description:
    description:
      - Group description.
    type: str
  domain_id:
    description:
      - Domain id to create the group in.
    type: str
  name:
    description:
      - Group name
    required: true
    type: str
  state:
    description:
      - Should the resource be present or absent.
    choices: ['present', 'absent']
    default: present
    type: str
extends_documentation_fragment:
  - openstack.cloud.openstack
a  
- name: Create a group named "demo"
  openstack.cloud.identity_group:
    cloud: mycloud
    state: present
    name: demo
    description: "Demo Group"
    domain_id: demoid

- name: Update the description on existing demo group
  openstack.cloud.identity_group:
    cloud: mycloud
    state: present
    name: demo
    description: "Something else"
    domain_id: demoid

- name: Delete group named demo
  openstack.cloud.identity_group:
    cloud: mycloud
    state: absent
    name: demo
a  
group:
  description: Dictionary describing the identity group.
  returned: On success when I(state) is C(present).
  type: dict
  contains:
    description:
      description: Group description
      type: str
      sample: "Demo Group"
    domain_id:
      description: Domain for the group
      type: str
      sample: "default"
    id:
      description: Unique group ID
      type: str
      sample: "ee6156ff04c645f481a6738311aea0b0"
    name:
      description: Group name
      type: str
      sample: "demo"
    )OpenStackModule)StateMachinec            
           e Zd Z e e        e        ed       edddg            Z ed      Z G d d	e      Zd
 Zy)IdentityGroupModuleT)requiredpresentabsent)defaultchoices)description	domain_idnamestate)supports_check_modec                       e Zd Zd Zy)!IdentityGroupModule._StateMachinec                 X    t        fddD              } | j                  d   fi |S )Nc              3   >   K   | ]  }|v r|   	||   f  y wN ).0k
attributess     r/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/openstack/cloud/plugins/modules/identity_group.py	<genexpr>z:IdentityGroupModule._StateMachine._find.<locals>.<genexpr>h   s4      L*_A1J jm, Ls   )r   r   )dictfind_function)selfr   kwargss    ` r   _findz'IdentityGroupModule._StateMachine._findg   s<     L#0L LF &4%%j&8CFCC    N)__name__
__module____qualname__r    r   r!   r   _StateMachiner   f   s    	Dr!   r%   c                 h     j                   j                  dd j                        }t         fddD              }t         fddD              |d<    |d j                  j
                  d d	gd
d|\  }}| j                  |       y  j                  ||j                  d
             y )Nidentitygroup)
connectionservice_name	type_namesdkc              3   ^   K   | ]$  }j                   |   |j                   |   f & y wr   paramsr   r   r   s     r   r   z*IdentityGroupModule.run.<locals>.<genexpr>t   s4      5Q3 $++a.) 5   *-)r   timeoutc              3   ^   K   | ]$  }j                   |   |j                   |   f & y wr   r.   r0   s     r   r   z*IdentityGroupModule.run.<locals>.<genexpr>y   s4      0KKN. T[[^$ 0r1   )r   r   r   r   r   F)
check_modeupdateable_attributesnon_updateable_attributeswait)changed)computed)r8   r(   r   )r%   connr,   r   ansibler4   	exit_jsonto_dict)r   smr   r(   
is_changeds   `    r   runzIdentityGroupModule.runn   s    499-7*1$(HH   .
  535 5
  0>0 0 	|
  )$,,*A*A59:E$)) "(	)z =NN:N.NN:!&!>  @r!   N)	r"   r#   r$   r   argument_specmodule_kwargsr   r%   r@   r   r!   r   r   r   Z   sP    F&4 9x.CD	M  MD D@r!   r   c                  &    t               }  |         y r   )r   )modules    r   mainrE      s     "F
Hr!   __main__N)
DOCUMENTATIONEXAMPLESRETURNBansible_collections.openstack.cloud.plugins.module_utils.openstackr   Aansible_collections.openstack.cloud.plugins.module_utils.resourcer   r   rE   r"   r   r!   r   <module>rL      sK   >0
0 _ Z-@/ -@`
 zF r!   