Ansible Policy & Modernization Engine — organization policy gate for PR validation
APME is the platform's final PR quality gate (Step 9, gate 6). It runs after ansible-lint, molecule, and build verification via Tekton/Pipelines as Code, scanning Ansible content against organization policies using the in-cluster APME service.
flowchart LR
PR[GitHub PR] --> PAC[PipelinesAsCode]
PAC --> Tekton[Tekton Pipeline]
Tekton --> Lint[ansible-lint / molecule]
Lint --> APME[apme-policy-check task]
APME --> Engine[APME Engine Service]
Engine --> Validators[Native / OPA / Ansible / Gitleaks]
APME --> GHCheck[GitHub Check Status]
APME is deployed via ArgoCD application applications/apme/:
- Helm chart:
apme/apmefromhttps://ansible.github.io/apme - Namespace:
apme - Route:
apme.apps.<cluster-domain>(UI + Gateway API at/api) - Image tag:
2026.8.6(pinned to chartappVersion)
# Verify after sync
oc -n apme get pods
oc -n apme get route apme
curl -k https://apme.apps.<cluster-domain>/api/v1/healthCentral policies live in rh1-cluster-config/applications/apme/policies/:
| File | Purpose |
|---|---|
rules.yml |
Rule severity overrides and enable/disable flags |
opa/ |
Custom OPA Rego bundles (optional) |
Synced to CI namespaces as ConfigMap apme-org-policies.
Content repos may add .apme/rules.yml for repo-specific settings and .apme/suppressions.yml for approved exceptions.
PAC pipeline .tekton/build-and-test.yml:
fetch-source → build → molecule → apme-policy-check
PAC pipeline .tekton/pr-policy.yml:
fetch-source → apme-policy-check
rh1-cluster-config/tekton-tasks/apme-policy-check-task.yml
| Param | Default | Description |
|---|---|---|
apme-primary-address |
apme-engine.apme.svc.cluster.local:50060 |
APME Primary gRPC endpoint |
fail-on-severity |
error |
Minimum severity that fails the task |
ansible-version |
2.17 |
Target ansible-core for migration rules |
Configure required status checks on main:
apme-policy-check(PAC/Tekton)ansible-lint(GitHub Actions)molecule/all_green(as applicable)
APME runs only on Tekton to avoid duplicate scans. GitHub Actions handles fast feedback; APME enforces org policy before merge.
Port-forward APME and run checks before opening a PR:
oc -n apme port-forward svc/apme-engine 50060:50060 &
export APME_PRIMARY_ADDRESS=127.0.0.1:50060
pip install "apme-engine @ git+https://github.com/ansible/apme.git@v2026.8.6"
apme check .For remediation (not run in CI):
apme remediate --interactive .| Issue | Check |
|---|---|
| Task cannot reach APME | oc -n apme get svc; verify apme-primary-address param |
| Policy not applied | ConfigMap apme-org-policies in CI namespace |
| False positive | Add .apme/suppressions.yml or adjust org rules.yml |
| Slow PR pipeline | APME runs last by design; check engine pod resources |
- PLATFORM-GUIDE.md — Step 9 PR workflow
- VALIDATION-QUALITY-GUIDE.md — Validation layers
- CICD-GUIDE.md — Tekton task reference
- SECURITY-GUIDE.md — Policy enforcement