scale_computing.hypercore.hypercore inventory – Inventory source for Scale Computing HyperCore.

Note

This inventory plugin is part of the scale_computing.hypercore collection (version 1.6.0).

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 scale_computing.hypercore.

To use it in a playbook, specify: scale_computing.hypercore.hypercore.

New in scale_computing.hypercore 1.0.0

Synopsis

  • Builds an inventory containing VMs on Scale Computing HyperCore.

  • Inventory uses tags to group VMs and to add variables to inventory.

  • VM can be added to multiple groups.

  • Available tags - ansible_host__, ansible_group__, ansible_user__, ansible_port__, ansible_ssh_private_key_file__.

  • Does not support caching.

Parameters

Parameter

Comments

look_for_ansible_disable

boolean

If missing, no VMs are excluded into inventory.

If set, then VMs with “ansible_disable” tag are not included into inventory.

Choices:

  • false ← (default)

  • true

look_for_ansible_enable

boolean

If missing, all VMs are included into inventory.

If set, then only VMs with “ansible_enable” tag are included into inventory.

Choices:

  • false ← (default)

  • true

plugin

string / required

The name of the Hypercore Inventory Plugin.

This should always be scale_computing.hypercore.hypercore.

Choices:

  • "scale_computing.hypercore.hypercore"

Examples

# A trivial example that creates a list of all VMs.
# No groups will be created - all the resulting hosts are ungrouped.

plugin: scale_computing.hypercore.hypercore

# `ansible-inventory -i examples/hypercore_inventory.yaml --graph` output:
# @all:
#   |--@grp0:
#   |  |--ci-inventory-vm4
#   |  |--ci-inventory-vm6
#   |--@grp1:
#   |  |--ci-inventory-vm5
#   |  |--ci-inventory-vm6
#   |--@ungrouped:
#   |  |--ci-inventory-vm2
#   |  |--ci-inventory-vm3


# Example with all available parameters and how to set them.
# A group "my-group" is created where all the VMs with "ansbile_enable" tag are added.
# For VM "ci-inventory-vm6" we added values for host and user, every other VM has default values.

plugin: scale_computing.hypercore.hypercore  # yamllint disable rule:key-duplicates

look_for_ansible_enable: true
look_for_ansible_disable: true

# `ansible-inventory -i hypercore_inventory.yaml --list` output:
# {
#     "_meta": {
#         "hostvars": {
#             "ci-inventory-vm2": {
#                 "ansible_host": "10.0.0.2",
#                "ansible_port": 22,
#                 "ansible_user": "root"
#             },
#             "ci-inventory-vm3": {
#                "ansible_host": "10.0.0.3",
#                "ansible_port": 22,
#                "ansible_user": "root"
#             },
#             "ci-inventory-vm4": {
#                "ansible_host": "10.0.0.4",
#                "ansible_port": 22,
#                "ansible_user": "root"
#             },
#             "ci-inventory-vm5": {
#                "ansible_host": "ci-inventory-vm5",
#                "ansible_port": 22,
#                "ansible_user": "root"
#             },
#             "ci-inventory-vm6": {
#                "ansible_host": "ci-inventory-vm6",
#                "ansible_port": 22,
#                "ansible_user": "root"
#            }
#        }
#     },
#     "all": {
#         "children": [
#            "grp0",
#            "grp1",
#            "ungrouped"
#         ]
#     },
#    "grp0": {
#         "hosts": [
#            "ci-inventory-vm4",
#            "ci-inventory-vm6"
#         ]
#    },
#     "grp1": {
#         "hosts": [
#             "ci-inventory-vm5",
#             "ci-inventory-vm6"
#         ]
#     },
#     "ungrouped": {
#         "hosts": [
#             "ci-inventory-vm2",
#            "ci-inventory-vm3"
#         ]
#    }
# }

Authors

  • Domen Dobnikar (@domen_dobnikar)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.