ripclawffb.helix_core.helix_core inventory – Perforce Helix Core dynamic inventory plugin
Note
This inventory plugin is part of the ripclawffb.helix_core collection (version 1.3.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 ripclawffb.helix_core.
You need further requirements to be able to use this inventory plugin,
see Requirements for details.
To use it in a playbook, specify: ripclawffb.helix_core.helix_core.
New in ripclawffb.helix_core 1.3.0
Synopsis
Discovers Perforce server topology by querying
p4 servers.Each registered server becomes an Ansible host, keyed by its
ServerID.Hosts are automatically grouped by server type (commit, edge, replica, etc.).
Supports Constructable features like
compose,keyed_groups, andgroups.Ideal for federated Perforce environments with commit + edge/replica servers.
Requirements
The below requirements are needed on the local controller node that executes this inventory.
P4Python pip module is required
Parameters
Parameter |
Comments |
|---|---|
Character set used for translation of unicode files. Can also use Default: Configuration:
|
|
Create vars from jinja2 expressions. Default: |
|
Add hosts to group based on Jinja2 conditionals. Default: |
|
Whether to include the commit server itself in the inventory. Only relevant when the commit server has a registered server spec. Choices:
|
|
Add hosts to group based on the values of a variable. Default: |
|
The default value when the host variable’s value is an empty string. This option is mutually exclusive with |
|
The key from input dictionary used to generate groups |
|
parent group for keyed group |
|
A keyed group name will start with this prefix Default: |
|
separator used to build the keyed group name Default: |
|
Set this option to This option is mutually exclusive with Choices:
|
|
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. Choices:
|
|
The login password for the Perforce user. Can also use Configuration:
|
|
Token to ensure this is an inventory plugin file. Choices:
|
|
The hostname/ip and port of the Perforce server (e.g. Can also use Configuration:
|
|
Optional list of server types to include in the inventory. Valid types include If omitted, all server types are included. Default: |
|
If Since it is possible to use facts in the expressions they might not always be available and we ignore those errors by default. Choices:
|
|
Merge extra vars into the available variables for composition (highest precedence). Choices:
Configuration:
|
|
A Perforce user with permission to run Can also use Configuration:
|
Note
Configuration entries listed above for each entry type (Ansible variable, environment variable, and so on) 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. The entry types are also ordered by precedence from low to high priority order. For example, an ansible.cfg entry (further up in the list) is overwritten by an Ansible variable (further down in the list).
Examples
# Minimal inventory file — discover all servers
# inventory.helix_core.yml
plugin: ripclawffb.helix_core.helix_core
server: ssl:commit-server:1666
user: admin
password: "{{ vault_p4_password }}"
# Filter to only edge servers and group by type
plugin: ripclawffb.helix_core.helix_core
server: ssl:commit-server:1666
user: admin
password: "{{ vault_p4_password }}"
server_types:
- edge-server
- commit-server
keyed_groups:
- key: server_type
prefix: p4
separator: "_"
# Use compose to set ansible_host from the server address
plugin: ripclawffb.helix_core.helix_core
server: ssl:commit-server:1666
user: admin
password: "{{ vault_p4_password }}"
compose:
ansible_port: 22