DevOpsInterviewPrep logo
← 🏗️ Declarative Infrastructure
Foundational

AAP job template launch contracts: inventory, surveys and delegated authority

Design an automation-controller job template with bounded launch inputs. Distinguish permission to execute an approved operation from permission to alter its code, targets or credentials.

TL;DR: A job template defines both an operation and the inputs a caller may vary. Delegate execution only after reviewing prompted fields, surveys, source overrides and the credentials available to the job. A friendly form does not establish a safe authorization boundary.

A launch is more than a playbook name

The same playbook can patch staging or production, select different hosts, and authenticate with different authority. A template combines its project and playbook with inventory, runtime and other launch settings. Each enabled prompt adds a dimension the caller may influence, subject to the platform's resource permissions.

Red Hat's AAP 2.6 template reference describes promptable fields and their exceptions. Review the actual template rather than assuming that selecting “Execute” makes every launch field fixed. Branch overrides also depend on project configuration.

rendering diagram…

Define the permitted operation

For a teaching example, a support team may restart one service on a selected staging host. They may choose the host and a ticket reference. They must not choose a production inventory, arbitrary source branch, shell command or privilege-escalation credential.

Write those permissions as acceptance cases before configuring the form. Use a dedicated staging template and credentials with authority limited to that operation. Protect edits to the project and template separately from launch access. Someone able to replace the approved playbook can often change what a stored credential is used to do even without learning its plaintext value.

Launch inputAllowed change in this exampleRequired verification
Host selectionOne host within staging scopeUnknown and out-of-scope hosts rejected
Ticket referenceNonempty bounded stringInvalid input rejected before mutation
InventoryFixed staging inventoryOperator cannot select production
Source revisionReviewed automation versionOperator cannot supply arbitrary code
CredentialFixed limited credentialOperator cannot substitute broader authority

A host limit narrows a play's selected inventory hosts; it is not a replacement for resource permissions. Also review tasks using delegation, local API calls or dynamic targets, because their effects may extend beyond the host pattern displayed in the launch form.

Surveys need a playbook contract

Survey answers become extra variables, which have high precedence in Ansible. That is useful for bounded inputs and dangerous when an answer redefines an internal control variable. Keep public input names separate from values that enforce policy, and validate inputs before any mutating task.

Suppose the survey offers operation: restart but a freely editable extra-variable prompt also accepts command. If the playbook interpolates command into a shell task, the survey's choices have not constrained the real operation. Remove the arbitrary execution path and test both UI and API launch behavior. A disabled field in one UI is insufficient evidence about all callers.

Review the Ansible input-contract example for type and range checks. Store secrets in the appropriate credential mechanism instead of survey text or ordinary debug output. Redaction lowers disclosure risk; it does not limit what trusted automation can do with a credential.

Test delegation with the operator identity

Use a nonadministrator test identity with the intended team roles. Launch the allowed staging restart and retain the effective inventory, limit, revision and sanitized variables. Then attempt a production inventory override, an unapproved branch and a malformed input. Record whether each is rejected at launch or by the playbook before a change.

The acceptance criterion is the bounded effect. A job that reports success after matching zero hosts has not proved the service restarted. Check the matched-host set and verify the intended service state afterward. If a negative case starts execution, determine whether the platform accepted the input and whether the playbook still prevented the effect.

Self-check: an operator cannot view a machine credential's secret, but can edit arbitrary code executed with that credential. Is the credential safe from misuse? No. The code can use the granted authority. Separate code/template administration from execution and restrict the credential's remote permissions.

Use the production-inventory launch scenario to rehearse an access review with explicit allowed and denied cases.

RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS