
    Vh	                     p    d Z dZdZddlmZ 	 ddlZddlmZ dZd	 Z
ed
k(  r e
        yy# e	$ r dZY w xY w)a  
---
module: config
short_description: Get OpenStack Client config
author: OpenStack Ansible SIG
description:
  - Get OpenStack cloud credentials and configuration,
    e.g. from clouds.yaml and environment variables.
options:
   clouds:
     description:
        - List of clouds to limit the return list to.
        - When I(clouds) is not defined, then data
          is returned for all configured clouds.
     default: []
     type: list
     elements: str
requirements:
  - "python >= 3.6"
  - "openstacksdk >= 1.0.0"
a  
clouds:
  description: List of OpenStack cloud configurations.
  returned: always
  type: list
  elements: dict
  contains:
    name:
      description: Name of the cloud.
      type: str
    config:
      description: A dict of configuration values for the CloudRegion and
                   its services. The key for a ${config_option} for a
                   specific ${service} should be ${service}_${config_option}.
      type: dict
a  
- name: Read configuration of all defined clouds
  openstack.cloud.config:
  register: config

- name: Print clouds which do not support security groups
  loop: "{{ config.clouds }}"
  when: item.config.secgroup_source|default(None) != None
  debug:
    var: item

- name: Read configuration of a two specific clouds
  openstack.cloud.config:
    clouds:
      - devstack
      - mordred
    )AnsibleModuleN)
exceptionsTFc            	      $   t        t        t        dg d                  } t        s| j                  d       	 t        j
                  j                         j                         D cg c]M  }| j                  d   r|j                  | j                  d   v r!t        |j                  |j
                  	      O }}| j                  d
|       y c c}w # t        j                  $ r%}| j                  t        |             Y d }~y d }~ww xY w)Nliststr)typedefaultelements)clouds)argument_specz(openstacksdk is required for this module)msgr   )nameconfigF)changedr   )r   dictHAS_OPENSTACKSDK	fail_json	openstackr   OpenStackConfigget_allparamsr   	exit_jsonr   SDKExceptionr   )modulecloudr   es       j/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/openstack/cloud/plugins/modules/config.pymainr   J   s    VR%@
F GH	%(//??AIIK<x0ZZ6==#:: EJJu||< < <
 	v6< "" %SV$$%s*   .C *AC<C C D*D

D__main__)DOCUMENTATIONRETURNEXAMPLESansible.module_utils.basicr   openstack.configr   r   r   ImportErrorr   __name__     r   <module>r)      s`   ,
"$ 5$
%, zF 5  s   + 55