eigenstate-ipa

Principal Capabilities

Related docs:

  PRINCIPAL PLUGIN     PRINCIPAL USE CASES     IDM VAULT CAPABILITIES     DOCS MAP  

Purpose

Use this guide to choose the right principal state lookup pattern for your automation.

It is the companion to the principal plugin reference. Use the reference for exact option syntax; use this guide when you are designing a workflow and need to know which capability fits your situation.

Contents

Capability Model

flowchart LR
    need["Principal state question"]
    check["Existence, keys,\nlock state, or last auth"]
    bulk["Single principal\nor bulk search"]
    gate["Gate or report"]
    act["Then get keytab,\nrequest cert, or stop"]

    need --> check
    need --> bulk
    check --> gate
    bulk --> gate
    gate --> act

The principal plugin is a read-only pre-flight primitive. It does not create or modify IdM objects. Use it to answer state questions and to gate automation that should only proceed when the answer is correct.

1. Pre-flight Before Keytab Issuance

Use eigenstate.ipa.principal before calling eigenstate.ipa.keytab when you need to confirm the service principal exists and already has keytab keys registered in IdM.

Typical cases:

flowchart LR
    check["principal show\nservice principal"] --> exists{"exists?"}
    exists -->|no| fail["fail — service not enrolled"]
    exists -->|yes| keys{"has_keytab?"}
    keys -->|no| warn["warn or fail — no keys yet"]
    keys -->|yes| keytab["eigenstate.ipa.keytab\nretrieve keytab"]

Why this pattern fits:

2. Pre-flight Before Cert Request

Use eigenstate.ipa.principal before calling eigenstate.ipa.cert with operation=request when you want to confirm the host is enrolled in IdM before attempting certificate issuance.

Typical cases:

flowchart LR
    check["principal show\nhost principal"] --> enrolled{"exists?"}
    enrolled -->|no| fail["fail — host not enrolled in IdM"]
    enrolled -->|yes| cert["eigenstate.ipa.cert\noperation=request"]

Why this pattern fits:

3. User Principal State Inspection

Use eigenstate.ipa.principal to check whether a service account is locked or has recent authentication activity before a play runs automation under that account or grants it additional access.

Typical cases:

flowchart LR
    check["principal show\nuser principal"] --> locked{"disabled?"}
    locked -->|yes| fail["fail or skip — account is locked"]
    locked -->|no| auth{"last_auth recent?"}
    auth -->|no| warn["warn — stale account"]
    auth -->|yes| proceed["proceed with automation"]

Why this pattern fits:

4. Bulk Missing-Keytab Audit

Use operation=find with principal_type=service or principal_type=host to enumerate all principals of a type, then filter the result to those where has_keytab=false.

Typical cases:

flowchart LR
    find["principal find\nprincipal_type=service"] --> all["all service principals"]
    all --> filter["filter where has_keytab=false"]
    filter --> empty{"any missing?"}
    empty -->|yes| report["report or fail"]
    empty -->|no| pass["all principals have keys"]

Why this pattern fits:

5. Pipeline Gate — Abort When Principal Absent

Use ansible.builtin.assert with the principal state record to abort a pipeline stage when a required principal is absent or in the wrong state.

Typical cases:

flowchart LR
    check["principal show\n(all required principals)"] --> assert{"all exist\nand have keys?"}
    assert -->|yes| deploy["proceed to deploy stage"]
    assert -->|no| abort["fail with diagnostic message"]

Why this pattern fits:

6. Cross-Plugin: Principal Check Then Keytab Retrieval

Combine eigenstate.ipa.principal and eigenstate.ipa.keytab in the same play when you want to pre-validate and then retrieve in a single role.

flowchart LR
    show["principal show\nservice principal"] --> gate{"exists and\nhas_keytab?"}
    gate -->|no| fail["fail — principal not ready"]
    gate -->|yes| keytab["keytab retrieve\nwrite to target host"]

This is the recommended pattern for any role that manages keytab lifecycle. The principal check step costs one extra ipalib query but pays for itself by producing a clear error when the downstream step would otherwise fail silently.

7. Cross-Plugin: Principal Check Then Cert Request

Combine eigenstate.ipa.principal and eigenstate.ipa.cert when requesting a certificate for a host or service.

flowchart LR
    show["principal show\nhost or service principal"] --> enrolled{"exists?"}
    enrolled -->|no| fail["fail — not enrolled"]
    enrolled -->|yes| cert["cert request\nCSR → IdM CA"]

Use this pattern in roles that manage host or service certificate lifecycle, particularly when the role may run before the target is enrolled in IdM.

8. Enrollment Verification After Host Join

Use eigenstate.ipa.principal as the verification step after ipa-client-install completes, to confirm IdM has the host record and that keys have been issued.

Typical cases:

flowchart LR
    install["ipa-client-install\non target host"] --> verify["principal show\nhost/target.example.com"]
    verify --> enrolled{"exists?"}
    enrolled -->|no| fail["fail — client install did not register"]
    enrolled -->|yes| keytab{"has_keytab?"}
    keytab -->|yes| next["proceed to cert/vault/keytab operations"]
    keytab -->|no| warn["warn — host enrolled but no keys yet"]

Why this pattern fits:

Quick Decision Matrix

Need Best capability
Confirm service exists before issuing keytab Pre-flight before keytab issuance (#1)
Confirm host enrolled before requesting cert Pre-flight before cert request (#2)
Check user account is active before automation User principal state inspection (#3)
Find all service principals missing keys Bulk missing-keytab audit (#4)
Abort entire pipeline if any principal is wrong Pipeline gate assertion (#5)
Pre-validate then retrieve keytab in one play Cross-plugin: principal + keytab (#6)
Pre-validate then request cert in one play Cross-plugin: principal + cert (#7)
Confirm host join succeeded after enrollment Enrollment verification (#8)

For option-level behavior, field definitions, and exact lookup syntax, return to PRINCIPAL PLUGIN.