eigenstate-ipa

Inventory Capabilities

Related docs:

  INVENTORY PLUGIN     IDM VAULT CAPABILITIES     AAP INTEGRATION     DOCS MAP  

Purpose

Use this guide to choose the IdM-backed inventory source exposed by eigenstate.ipa.idm.

The focus here is operational boundary selection, not option reference.

Contents

Relationship Model

flowchart LR
    hosts["IdM hosts"]
    hostgroups["IdM hostgroups"]
    netgroups["IdM netgroups"]
    hbac["IdM HBAC rules"]
    plugin["eigenstate.ipa.idm"]
    inv["Ansible inventory"]

    hosts --> plugin
    hostgroups --> plugin
    netgroups --> plugin
    hbac --> plugin
    plugin --> inv

The model is:

Use the object type that matches the operational boundary you actually care about.

Assumed Example Estate

All examples assume an IdM domain corp.example.com with enrolled hosts, nested hostgroups, netgroups, and HBAC rules representing a small production and staging estate.

[!NOTE] The examples are illustrative. The important part is the decision boundary: role, access boundary, or security policy.

1. Hosts: Full Estate Discovery

Use hosts when you need every enrolled system regardless of role grouping.

Typical cases:

flowchart LR
    H["All enrolled hosts"] --> P["sources: [hosts]"] --> A["all hosts in inventory"]

Example inventory:

plugin: eigenstate.ipa.idm
server: idm-01.corp.example.com
ipaadmin_password: "{{ lookup('env', 'IPA_ADMIN_PASSWORD') }}"
verify: /etc/ipa/ca.crt
sources:
  - hosts
compose:
  ansible_host: idm_fqdn

Why this source fits:

2. Hostgroups: Role-Based Targeting

Use hostgroups when IdM hostgroups already model infrastructure roles.

Typical cases:

flowchart LR
    HG["IdM hostgroups\nwebservers, databases"] --> P["sources: [hosts, hostgroups]"] --> G["Ansible groups\nidm_hostgroup_*"]

Example inventory:

plugin: eigenstate.ipa.idm
server: idm-01.corp.example.com
ipaadmin_password: "{{ lookup('env', 'IPA_ADMIN_PASSWORD') }}"
verify: /etc/ipa/ca.crt
sources:
  - hosts
  - hostgroups
hostgroup_filter:
  - webservers
  - databases
host_filter_from_groups: true

Why this source fits:

Hostgroups Plus keyed_groups

Sometimes IdM stores the useful boundary as metadata instead of a named hostgroup. In that case, keep hosts in scope and build additional groups from attributes such as idm_location or idm_os.

That pattern is useful for:

3. Netgroups: Access-Boundary Targeting

Use netgroups when the boundary is who can reach a host rather than what the host does.

Typical cases:

flowchart LR
    NG["IdM netgroups\nops-admin-access"] --> P["sources: [hosts, netgroups]"] --> G["Ansible groups\nidm_netgroup_*"]

Example inventory:

plugin: eigenstate.ipa.idm
server: idm-01.corp.example.com
ipaadmin_password: "{{ lookup('env', 'IPA_ADMIN_PASSWORD') }}"
verify: /etc/ipa/ca.crt
sources:
  - hosts
  - netgroups
netgroup_filter:
  - ops-admin-access
host_filter_from_groups: true

Why this source fits:

4. HBAC Rules: Policy-Driven Targeting

Use hbacrules when the operational boundary is the enforced access policy itself.

Typical cases:

flowchart LR
    HB["HBAC rules\nallow_ssh_ops"] --> P["sources: [hosts, hbacrules]"] --> G["Ansible groups\nidm_hbacrule_*"]

Example inventory:

plugin: eigenstate.ipa.idm
server: idm-01.corp.example.com
ipaadmin_password: "{{ lookup('env', 'IPA_ADMIN_PASSWORD') }}"
verify: /etc/ipa/ca.crt
sources:
  - hosts
  - hbacrules
hbacrule_filter:
  - allow_ssh_ops
host_filter_from_groups: true

Why this source fits:

[!TIP] If you are deciding between hostgroups and HBAC rules, ask a narrower question: are you targeting by system role or by authorization policy? If the answer is policy, use HBAC rules.

5. Host Metadata Enrichment

Use inventory hostvar enrichment when IdM host metadata is the real execution input and named groups are either too coarse or do not exist yet.

Typical cases:

flowchart LR
    META["Curated idm_* host vars"] --> KG["compose / keyed_groups / groups"] --> RUN["execution boundary built from metadata"]

Recommended pattern:

Quick Decision Matrix

Need Best source
Every enrolled system hosts
Systems by infrastructure role hostgroups
Systems by who may access them netgroups
Systems by enforced access policy hbacrules
Metadata-driven targeting hosts plus curated idm_* hostvars

Operational Pattern

The most useful operator sequence is usually:

  1. include hosts so host vars are always present
  2. add the object source that matches the execution boundary
  3. add filters to limit groups
  4. enable host_filter_from_groups: true when you need the host list trimmed to the selected boundary

For option-level details and exact field behavior, return to INVENTORY PLUGIN.