openstack.cloud.config module – Get OpenStack Client config

Note

This module is part of the openstack.cloud collection (version 2.2.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install openstack.cloud. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: openstack.cloud.config.

Synopsis

  • Get OpenStack cloud credentials and configuration, e.g. from clouds.yaml and environment variables.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.6

  • openstacksdk >= 1.0.0

Parameters

Parameter

Comments

clouds

list / elements=string

List of clouds to limit the return list to.

When clouds is not defined, then data is returned for all configured clouds.

Default: []

Examples

- 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

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

clouds

list / elements=dictionary

List of OpenStack cloud configurations.

Returned: always

config

dictionary

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}.

Returned: success

name

string

Name of the cloud.

Returned: success

Authors

  • OpenStack Ansible SIG