Rewrite PG templates to match upstream; add 4.19-4.22 support; default to PolicyGenerator#191
Conversation
akrzos
commented
Jul 1, 2026
- Rewrite pg-du-4.18/ to match upstream cnf-features-deploy format with acm- prefix filenames, removing the old common/ and group-du/ subdirectory include pattern. Consolidates 4.18 and 4.19 with an ICSP/IDMS Jinja2 conditional.
- Add pg-du-4.20/ for OCP 4.20+ using telco-reference subdirectory source-crs paths. Consolidates 4.20, 4.21, and 4.22 since upstream PG files are identical.
- Default acm_policygenerator to true (PG is now primary, PGT deprecated).
- Add derived variables (_pg_du_profile_version, _policy_dir_prefix, _policy_file_prefix, _policy_template_version) to centralize PG/PGT switching for clean future PGT removal.
- Drop manyPolicies from PG templates to reduce complexity.
- Update tasks/main.yml to use derived variables instead of inline ternary.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (45)
💤 Files with no reviewable changes (21)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (13)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR switches the telco-ran-du-ztp role to PolicyGenerator defaults, adds derived naming variables, rewires manifest and generator filenames, introduces new 4.18 and 4.20 PolicyGenerator templates, and updates shared hub-annotation Jinja snippets. ChangesPG default switch and consolidated PolicyGenerator templates
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
438759c to
86e25c9
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-sno-ranGen.yaml (1)
60-76: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRepeated hub-template annotation block — consider extracting to a shared include.
The
extraHubGroupTemplates/extraHubSiteTemplatesannotation Jinja block is duplicated 7 times in this consolidated file (and similarly in sibling group-du templates). Extracting it into a small partial template ({% include %}) would reduce maintenance risk when this pattern changes.As per path instructions, "**" should focus on major issues impacting readability and maintainability.
Also applies to: 79-94, 128-142, 158-173, 179-194, 216-232, 252-267
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-sno-ranGen.yaml` around lines 60 - 76, The repeated hub-template annotation block in this template is duplicated across multiple conditional sections, so refactor it into a shared partial/include to improve maintainability. Extract the common `extraHubGroupTemplates`/`extraHubSiteTemplates` annotation markup from the current `acm-group-du-sno-ranGen.yaml` template into a reusable snippet, then reference that snippet wherever the same `patches`/`metadata.annotations` pattern appears in this file and the sibling group-du templates. Use the existing conditional blocks and the hub-specific symbols such as `extraHubGroupTemplates`, `extraHubSiteTemplates`, and `ManagedClusterName` to keep the behavior unchanged while removing duplication.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-sno-ranGen.yaml`:
- Around line 60-76: The repeated hub-template annotation block in this template
is duplicated across multiple conditional sections, so refactor it into a shared
partial/include to improve maintainability. Extract the common
`extraHubGroupTemplates`/`extraHubSiteTemplates` annotation markup from the
current `acm-group-du-sno-ranGen.yaml` template into a reusable snippet, then
reference that snippet wherever the same `patches`/`metadata.annotations`
pattern appears in this file and the sibling group-du templates. Use the
existing conditional blocks and the hub-specific symbols such as
`extraHubGroupTemplates`, `extraHubSiteTemplates`, and `ManagedClusterName` to
keep the behavior unchanged while removing duplication.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 95803316-b539-472b-ba6e-e69d8fbfed96
📒 Files selected for processing (42)
ansible/roles/telco-ran-du-ztp/defaults/main.ymlansible/roles/telco-ran-du-ztp/tasks/main.ymlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-common-mno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-common-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-3node-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-3node-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-sno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-sno-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-standard-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-standard-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-mno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/clo-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/lca-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/oadp-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/ptp-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/sriov-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/storage-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-3node-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-sno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-standard-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/disable-sno-network-diag.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/lca-config.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/oadp-config.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/olm-config.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-3node.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-sno.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-standard.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-config.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-operator-config-standard.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-3node.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-sno.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-standard.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-common-mno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-common-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-3node-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-3node-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-sno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-sno-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-standard-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-standard-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/policy-kustomization.yaml
💤 Files with no reviewable changes (23)
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/olm-config.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-config.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-operator-config-standard.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/clo-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-sno.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/storage-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-standard.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/ptp-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-mno-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-3node.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/lca-config.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/lca-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-standard.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-standard-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/oadp-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/oadp-config.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-3node-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-sno-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/disable-sno-network-diag.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/sriov-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-sno.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-3node.yaml
95aa99a to
ccfd7a0
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-3node-ranGen.yaml (1)
57-73: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winParameterize the 3-node PerformanceProfile values too The 3-node template still hardcodes CPU and hugepage values while the SNO template uses
setup_ztp_perfprofile_*. If these values are meant to vary by platform, add matching variables/defaults here so both paths stay aligned.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-3node-ranGen.yaml` around lines 57 - 73, The 3-node PerformanceProfile block still hardcodes platform-specific CPU and hugepage settings. Update the PerformanceProfile patch in the 3-node template to use the same setup_ztp_perfprofile_* variables/defaults pattern as the SNO path, and reference the PerformanceProfile-SetSelector section so both templates stay aligned and configurable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-3node-ranGen.yaml`:
- Around line 57-73: The 3-node PerformanceProfile block still hardcodes
platform-specific CPU and hugepage settings. Update the PerformanceProfile patch
in the 3-node template to use the same setup_ztp_perfprofile_*
variables/defaults pattern as the SNO path, and reference the
PerformanceProfile-SetSelector section so both templates stay aligned and
configurable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: f0e79538-8476-4cdb-be36-15b71058bb54
📒 Files selected for processing (45)
ansible/roles/telco-ran-du-ztp/defaults/main.ymlansible/roles/telco-ran-du-ztp/tasks/main.ymlansible/roles/telco-ran-du-ztp/templates/pg-common/common-hub-annotations-10.j2ansible/roles/telco-ran-du-ztp/templates/pg-common/common-hub-annotations.j2ansible/roles/telco-ran-du-ztp/templates/pg-common/group-hub-annotations-10.j2ansible/roles/telco-ran-du-ztp/templates/pg-common/group-hub-annotations-12.j2ansible/roles/telco-ran-du-ztp/templates/pg-common/group-hub-annotations.j2ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-common-mno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-common-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-3node-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-3node-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-sno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-sno-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-standard-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-group-du-standard-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-mno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/clo-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/lca-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/oadp-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/ptp-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/sriov-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/storage-sub.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-3node-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-sno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-standard-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/lca-config.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/oadp-config.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-3node.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-sno.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-standard.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-config.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-operator-config-standard.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-3node.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-sno.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-standard.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-common-mno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-common-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-3node-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-3node-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-sno-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-sno-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-standard-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-standard-validator-ranGen.yamlansible/roles/telco-ran-du-ztp/templates/policy-kustomization.yaml
💤 Files with no reviewable changes (21)
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-operator-config-standard.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/lca-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-standard.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/oadp-config.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-standard-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-standard.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/lca-config.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-3node.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/storage-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-3node.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/performance-profile-sno.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-mno-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/ptp-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-sno-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/clo-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/sriov-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common/oadp-sub.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/ptp-config.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/common-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du/sriov-operator-config-sno.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/group-du-3node-ranGen.yaml
✅ Files skipped from review due to trivial changes (1)
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-standard-validator-ranGen.yaml
🚧 Files skipped from review as they are similar to previous changes (7)
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.18/acm-common-mno-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-common-mno-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-sno-validator-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/templates/pg-du-4.20/acm-group-du-3node-validator-ranGen.yaml
- ansible/roles/telco-ran-du-ztp/tasks/main.yml
- ansible/roles/telco-ran-du-ztp/defaults/main.yml
- ansible/roles/telco-ran-du-ztp/templates/policy-kustomization.yaml
ccfd7a0 to
1de8e7b
Compare
…t to PolicyGenerator - Rewrite pg-du-4.18/ to match upstream cnf-features-deploy format with acm- prefix filenames, removing the old common/ and group-du/ subdirectory include pattern. Consolidates 4.18 and 4.19 with an ICSP/IDMS Jinja2 conditional. - Add pg-du-4.20/ for OCP 4.20+ using telco-reference subdirectory source-crs paths. Consolidates 4.20, 4.21, and 4.22 since upstream PG files are identical. - Extract repeated hub annotation Jinja2 blocks into pg-common/ shared includes to reduce duplication across group-du and common templates. - Fix imageDigestMirrors to include all 5 mirror entries matching repositoryDigestMirrors; simplify 4.18 ICSP/IDMS conditional to share the common mirror list. - Default acm_policygenerator to true (PG is now primary, PGT deprecated). - Add derived variables (_pg_du_profile_version, _policy_dir_prefix, _policy_file_prefix, _policy_template_version) to centralize PG/PGT switching for clean future PGT removal. - Drop manyPolicies from PG templates to reduce complexity. - Update tasks/main.yml to use derived variables instead of inline ternary. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1de8e7b to
997a3fd
Compare