sshnaidm.cloud.openstack (2.0.0) — inventory

OpenStack inventory source

Authors: Marco Vito Moscaritolo <marco@agavee.com>, Jesse Keating <jesse.keating@rackspace.com>

Install collection

Install with ansible-galaxy collection install sshnaidm.cloud:==2.0.0


Add to requirements.yml

  collections:
    - name: sshnaidm.cloud
      version: 2.0.0

Description

Get inventory hosts from OpenStack clouds

Uses openstack.(yml|yaml) YAML configuration file to configure the inventory plugin

Uses standard clouds.yaml YAML configuration file to configure cloud credentials


Requirements

Inputs

    
cache:
    default: false
    description:
    - Toggle to enable/disable the caching of the inventory's source data, requires a
      cache plugin setup to work.
    env:
    - name: ANSIBLE_INVENTORY_CACHE
    ini:
    - key: cache
      section: inventory
    type: bool

groups:
    default: {}
    description: Add hosts to group based on Jinja2 conditionals.
    type: dictionary

plugin:
    choices:
    - openstack
    description: token that ensures this is a source file for the 'openstack' plugin.
    required: true

strict:
    default: false
    description:
    - If V(yes) make invalid entries a fatal error, otherwise skip and continue.
    - Since it is possible to use facts in the expressions they might not always be available
      and we ignore those errors by default.
    type: bool

compose:
    default: {}
    description: Create vars from jinja2 expressions.
    type: dictionary

private:
    default: 'no'
    description: 'Use the private interface of each server, if it has one, as

      the host''s IP in the inventory. This can be useful if you are

      running ansible inside a server in the cloud and would rather

      communicate to your servers over the private network.

      '
    type: bool

show_all:
    default: 'no'
    description: toggles showing all vms vs only those with a working IP
    type: bool

only_clouds:
    default: []
    description: 'List of clouds from clouds.yaml to use, instead of using

      the whole list.

      '
    type: list

all_projects:
    default: 'no'
    description: 'Lists servers from all projects

      '
    type: bool

cache_plugin:
    default: memory
    description:
    - Cache plugin to use for the inventory's source data.
    env:
    - name: ANSIBLE_CACHE_PLUGIN
    - name: ANSIBLE_INVENTORY_CACHE_PLUGIN
    ini:
    - key: fact_caching
      section: defaults
    - key: cache_plugin
      section: inventory
    type: str

cache_prefix:
    default: ansible_inventory_
    description:
    - Prefix to use for cache plugin files/tables
    env:
    - name: ANSIBLE_CACHE_PLUGIN_PREFIX
    - name: ANSIBLE_INVENTORY_CACHE_PLUGIN_PREFIX
    ini:
    - key: fact_caching_prefix
      section: defaults
    - key: cache_prefix
      section: inventory

keyed_groups:
    default: []
    description: Add hosts to group based on the values of a variable.
    elements: dict
    suboptions:
      default_value:
        description:
        - The default value when the host variable's value is an empty string.
        - This option is mutually exclusive with O(keyed_groups[].trailing_separator).
        type: str
        version_added: '2.12'
        version_added_collection: ansible.builtin
      key:
        description:
        - The key from input dictionary used to generate groups
        type: str
      parent_group:
        description: parent group for keyed group
        type: str
      prefix:
        default: ''
        description: A keyed group name will start with this prefix
        type: str
      separator:
        default: _
        description: separator used to build the keyed group name
        type: str
      trailing_separator:
        default: true
        description:
        - Set this option to V(False) to omit the O(keyed_groups[].separator) after the
          host variable when the value is an empty string.
        - This option is mutually exclusive with O(keyed_groups[].default_value).
        type: bool
        version_added: '2.12'
        version_added_collection: ansible.builtin
    type: list

cache_timeout:
    default: 3600
    description:
    - Cache duration in seconds
    env:
    - name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
    - name: ANSIBLE_INVENTORY_CACHE_TIMEOUT
    ini:
    - key: fact_caching_timeout
      section: defaults
    - key: cache_timeout
      section: inventory
    type: int

fail_on_errors:
    default: 'no'
    description: 'Causes the inventory to fail and return no hosts if one cloud

      has failed (for example, bad credentials or being offline).

      When set to False, the inventory will return as many hosts as

      it can from as many clouds as it can contact. (Note, the

      default value of this is opposite from the old openstack.py

      inventory script''s option fail_on_errors)

      '
    type: bool

use_extra_vars:
    default: false
    description: Merge extra vars into the available variables for composition (highest
      precedence).
    env:
    - name: ANSIBLE_INVENTORY_USE_EXTRA_VARS
    ini:
    - key: use_extra_vars
      section: inventory_plugins
    type: bool
    version_added: '2.11'
    version_added_collection: ansible.builtin

expand_hostvars:
    default: 'no'
    description: 'Run extra commands on each host to fill in additional

      information about the host. May interrogate cinder and

      neutron and can be expensive for people with many hosts.

      (Note, the default value of this is opposite from the default

      old openstack.py inventory script''s option expand_hostvars)

      '
    type: bool

cache_connection:
    description:
    - Cache connection data or path, read cache plugin documentation for specifics.
    env:
    - name: ANSIBLE_CACHE_PLUGIN_CONNECTION
    - name: ANSIBLE_INVENTORY_CACHE_CONNECTION
    ini:
    - key: fact_caching_connection
      section: defaults
    - key: cache_connection
      section: inventory
    type: str

clouds_yaml_path:
    description: 'Override path to clouds.yaml file. If this value is given it

      will be searched first. The default path for the

      ansible inventory adds /etc/ansible/openstack.yaml and

      /etc/ansible/openstack.yml to the regular locations documented

      at https://docs.openstack.org/os-client-config/latest/user/configuration.html#config-files

      '
    env:
    - name: OS_CLIENT_CONFIG_FILE
    type: list

leading_separator:
    default: true
    description:
    - Use in conjunction with keyed_groups.
    - By default, a keyed group that does not have a prefix or a separator provided will
      have a name that starts with an underscore.
    - This is because the default prefix is "" and the default separator is "_".
    - Set this option to False to omit the leading underscore (or other separator) if
      no prefix is given.
    - If the group name is derived from a mapping the separator is still used to concatenate
      the items.
    - To not use a separator in the group name at all, set the separator for the keyed
      group to an empty string instead.
    type: boolean
    version_added: '2.11'
    version_added_collection: ansible.builtin

inventory_hostname:
    choices:
    - name
    - uuid
    default: name
    description: 'What to register as the inventory hostname.

      If set to ''uuid'' the uuid of the server will be used and a

      group will be created for the server name.

      If set to ''name'' the name of the server will be used unless

      there are more than one server with the same name in which

      case the ''uuid'' logic will be used.

      Default is to do ''name'', which is the opposite of the old

      openstack.py inventory script''s option use_hostnames)

      '
    type: string