feat: Make the sysadmin-opensift-readonly group deploy in production #3188
No reviewers
Labels
No labels
ai-review-please
freeze-break-request
post-freeze
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
infra/ansible!3188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "smoliicek/ansible:readonly-openshift-prod"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
this isn't something that is urgently needed, so we can merge this after the freeze ends
Signed-off-by: Vít Smolík me@smoliicek.cz
AI Code Review
📋 MR Summary
This MR promotes the
sysadmin-openshift-readonlyrole, group, and rolebinding templates from staging to production by moving them to the main templates list.sysadmin-openshift-readonly-*files out of thestg_templatessection to the main template list.Detailed Code Review
The change correctly moves the templates to the main deployment list as intended. However, leaving the
stg_templateskey empty in YAML evaluates tonullrather than an empty list. If any downstream tasks iterate over this variable without a default filter (e.g.,loop: "{{ stg_templates | default([]) }}"), it will cause an Ansible runtime error. It is recommended to either remove the key entirely or explicitly set it to an empty list.📂 File Reviews
📄 `roles/openshift/cluster/tasks/main.yaml` - Moves read-only templates to the main template list.
stg_templates:empty evaluates tonullin YAML. If later tasks attempt to iterate overstg_templates, Ansible will throw a runtime error.stg_templatesto an empty list or remove the key entirely if it is no longer needed.✅ Summary
stg_templatesdoes not evaluate tonullby either assigning an empty list[]or removing the key entirely, to prevent Ansible iteration errors.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
AI Code Review
📋 MR Summary
This MR deploys the
sysadmin-openshift-readonlygroup to the production environment by moving its associated templates to the main templates list in the Ansible task.sysadmin-openshift-readonly-*templates fromstg_templatesto the default template list.stg_templatesas an empty list to prevent Ansible execution failures.stg_templatesarray resolves an existing Ansible bug without introducing complex logic.Detailed Code Review
The changes are straightforward and accurately reflect the PR description. Moving the
sysadmin-openshift-readonlyresources out of the staging-only list ensures they are deployed in production as intended. Initializingstg_templates: []is a correct and safe approach to fix the undefined variable issue in Ansible.No security, performance, or logic issues were found. As noted by the author, merging should be deferred until after the current freeze period.
📂 File Reviews
📄 `roles/openshift/cluster/tasks/main.yaml` - Updated template lists to include read-only resources in production and initialized staging templates as an empty list.
stg_templatesis used downstream in the playbook, you could consider omitting it entirely if empty lists are handled correctly by thewith_itemsor loop module. However, explicitly defining it as an empty list as done here is perfectly safe and prevents the 'undefined variable' error.✅ Summary
🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.