Skip to content

USHIFT-7443: Ansible: modernize task syntax - #7346

Open
sjug wants to merge 1 commit into
openshift:mainfrom
sjug:ansible-syntax-modernization
Open

USHIFT-7443: Ansible: modernize task syntax#7346
sjug wants to merge 1 commit into
openshift:mainfrom
sjug:ansible-syntax-modernization

Conversation

@sjug

@sjug sjug commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Modernizes Ansible task syntax and YAML formatting, and promotes the cleaned lint families from warnings to errors. Existing reboot notifications retain their handler aliases, workload task names retain QPS values, and shared variables remain exempt from role-specific naming prefixes. Adds two retries with ten-second delays to released-package installation; persistent failures still fail the run.

Tracks USHIFT-7443. The service-account include_role fix belongs to USHIFT-7499 and is not included in this PR.

Validation

make lint-ansible passes with 0 failures and 52 remaining warnings, down from 388 warnings on the local main baseline. The minimum profile passes; this is not production-profile clean. Playbook syntax and git diff --check pass.

Local RHEL 9.8 scratch-VM rehearsals passed with MicroShift 4.22.13 and 5.0.0-rc.1, exercising host setup, package installation, cold and warm boots, service-account creation and metrics collection. Both versions reached nine ready pods, six healthy Prometheus targets and populated boot, disk, image-size and network artifacts. The RC1 run completed with 276 tasks OK, 0 failures, 0 unreachable and 0 ignored; it installed CRI-O 5.0.0 and cri-tools 1.36.0.

Test copies included the separate USHIFT-7499 fix (#7340), which remains excluded from this PR. Prometheus used system mode on the same guest. RC1 was a clean reinstall on an existing configured VM, not a workload-preserving upgrade; the previous 4.22 RHSM repository remained enabled. RC1 cold/warm readiness took 65/273 seconds. Warm boot encountered CNI/OVN startup delays but recovered without intervention within the existing 600-second limit. These runs establish functional coverage, not performance equivalence or pristine-host dependency isolation.

Controlled retry testing confirmed recovery on the second attempt and failure after exactly three executions for a persistent error. Source builds, VM creation, GPU, pbench and workload execution were not live-qualified here. make verify-fast remains blocked by formatting findings in five unchanged rebase-managed dependency files under the host Go toolchain. Full CI rehearsal remains outstanding.

Normalize module names, task names, key ordering, Jinja spacing and
YAML formatting across the deployment automation. Promote the cleaned
lint families to errors while retaining the remaining behavioral warnings
and exempting shared variables from role-specific naming prefixes.

Preserve existing reboot notifications through handler listener aliases
and retain workload QPS values in task names. Retry released-package
installation twice at ten-second intervals so transient download failures
can recover while persistent failures still stop the run.

Signed-off-by: Sebastian Jug <seb@stianj.ug>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 8, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Sep 8, 2026

Copy link
Copy Markdown

@sjug: This pull request references USHIFT-7443 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Summary

Modernizes Ansible task syntax and YAML formatting, and promotes the cleaned lint families from warnings to errors. Existing reboot notifications retain their handler aliases, workload task names retain QPS values, and shared variables remain exempt from role-specific naming prefixes. Adds two retries with ten-second delays to released-package installation; persistent failures still fail the run.

Tracks USHIFT-7443. The service-account include_role fix belongs to USHIFT-7499 and is not included in this PR.

Validation

make lint-ansible passes with 0 failures and 52 remaining warnings, down from 388 warnings on the local main baseline. The minimum profile passes; this is not production-profile clean. Playbook syntax and git diff --check pass.

Local RHEL 9.8 scratch-VM validation of a released 4.22 installation completed host setup, package installation, cold and warm boots, and metrics collection. All nine pods became ready and all six Prometheus targets were healthy. Both baseline and candidate test copies included the separate USHIFT-7499 fix (#7340) and the bounded retry. Prometheus used system mode for this same-host test topology. The candidate completed a full run from the restored comparison snapshot; the baseline was resumed after prerequisite and harness corrections, so these results establish functional coverage, not performance equivalence.

Controlled retry testing confirmed recovery on the second attempt and failure after exactly three executions for a persistent error. Source builds, VM creation, GPU, pbench and workload execution were not live-qualified here. make verify-fast remains blocked by formatting findings in five unchanged rebase-managed dependency files under the host Go toolchain. Full CI rehearsal remains outstanding.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sjug
Once this PR has been reviewed and has the lgtm label, please assign eslutsky for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 4dcb3c3d-b23b-4beb-82c4-27e0bf7beb8e

📥 Commits

Reviewing files that changed from the base of the PR and between 813abf6 and be77f12.

📒 Files selected for processing (39)
  • .ansible-lint
  • ansible/roles/add-kubelet-logging/files/metrics-sa.yaml
  • ansible/roles/add-kubelet-logging/tasks/main.yml
  • ansible/roles/common/tasks/boot.yml
  • ansible/roles/common/tasks/disk.yml
  • ansible/roles/common/tasks/nodename.yml
  • ansible/roles/common/tasks/results-dir.yml
  • ansible/roles/configure-firewall/defaults/main.yml
  • ansible/roles/configure-firewall/tasks/main.yml
  • ansible/roles/create-service-account/files/metrics-sa.yaml
  • ansible/roles/create-service-account/tasks/main.yml
  • ansible/roles/create-vm/handlers/main.yml
  • ansible/roles/create-vm/tasks/main.yml
  • ansible/roles/fetch-kubeconfig/tasks/main.yml
  • ansible/roles/install-logging-exporters/defaults/main.yml
  • ansible/roles/install-logging-exporters/tasks/main.yml
  • ansible/roles/install-logging/tasks/main.yml
  • ansible/roles/install-microshift/tasks/main.yml
  • ansible/roles/manage-repos/defaults/main.yml
  • ansible/roles/manage-repos/tasks/create-mirrors.yaml
  • ansible/roles/manage-repos/tasks/main.yml
  • ansible/roles/manage-repos/tasks/probe-mirror.yaml
  • ansible/roles/microshift-start/tasks/main.yml
  • ansible/roles/nvidia-gpu-setup/defaults/main.yml
  • ansible/roles/nvidia-gpu-setup/tasks/main.yml
  • ansible/roles/nvidia-gpu-test/defaults/main.yml
  • ansible/roles/nvidia-gpu-test/tasks/main.yml
  • ansible/roles/quick-microshift-boot/tasks/main.yml
  • ansible/roles/run-workloads/tasks/kube-burner.yml
  • ansible/roles/run-workloads/tasks/main.yml
  • ansible/roles/setup-localhost/defaults/main.yml
  • ansible/roles/setup-localhost/tasks/main.yml
  • ansible/roles/setup-microshift-host/defaults/main.yml
  • ansible/roles/setup-microshift-host/handlers/main.yml
  • ansible/roles/setup-microshift-host/tasks/main.yml
  • ansible/roles/setup-microshift-host/tasks/storage.yml
  • ansible/setup-node.yml
  • ansible/vars/all.yml
  • ansible/vars/microshift_versions.yml
💤 Files with no reviewable changes (1)
  • ansible/roles/configure-firewall/defaults/main.yml

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The pull request standardizes Ansible lint configuration, YAML formatting, module qualification, task naming, boolean syntax, and block conditions across shared playbooks and roles. MicroShift package installation also gains retry-based success checking.

Changes

Ansible standardization

Layer / File(s) Summary
Lint rules and RBAC manifests
.ansible-lint, ansible/roles/*/files/metrics-sa.yaml, ansible/roles/create-service-account/tasks/main.yml
Lint skip and warning rules change. Metrics-server RBAC manifests receive formatting-only updates.
Shared tasks and setup playbook
ansible/roles/common/tasks/*, ansible/setup-node.yml, ansible/vars/*
Shared tasks and setup plays use qualified modules, explicit booleans, standardized names, and revised block conditions.
MicroShift installation and orchestration
ansible/roles/install-microshift/..., ansible/roles/manage-repos/..., ansible/roles/microshift-start/...
MicroShift installation adds package result checks with two retries and a 10-second delay. Repository and startup task structures are standardized.
Platform role syntax updates
ansible/roles/configure-firewall/..., ansible/roles/create-vm/..., ansible/roles/fetch-kubeconfig/..., ansible/roles/install-logging*/..., ansible/roles/setup-*/*, ansible/roles/add-kubelet-logging/...
Platform roles standardize task names, module names, boolean values, file modes, handlers, and YAML formatting.
GPU and workload role updates
ansible/roles/nvidia-gpu-*/..., ansible/roles/run-workloads/...
GPU and workload roles standardize quoting, booleans, whitespace, regular expressions, task names, and block conditions.

Priority: ➖ Normal — Schedule the Ansible modernization because it spans many MicroShift roles and adds bounded retries to released-package installation, despite no stated customer or external urgency.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to be77f

This change standardizes Ansible syntax and formatting while adding bounded package-install retries; failures still stop the run. No concrete current-head merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 16
✅ Passed checks (16 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Stable And Deterministic Test Names ✅ Passed PASS: The pull request changes only .ansible-lint and Ansible YAML/task files. The diff contains no Ginkgo test files, test-title declarations, or added/removed Describe, Context, When, It, …
Test Structure And Quality ✅ Passed PASS — The pull request changes only .ansible-lint and Ansible YAML/task files. The diff against origin/main contains no test paths and no Ginkgo markers such as It, BeforeEach, AfterEach, `…
Microshift Test Compatibility ✅ Passed PASS: The pull request changes only .ansible-lint and Ansible YAML files. The parent-to-HEAD diff contains no Go files, Ginkgo declarations, or added e2e tests. Therefore, the MicroShift API and fea…
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS — The pull request changes only Ansible configuration, task files, defaults, handlers, and YAML manifests. The parent-to-HEAD diff contains no new Ginkgo or e2e test files and no added It(), `D…
Topology-Aware Scheduling Compatibility ✅ Passed PASS. The pull request does not add or modify a Deployment, controller, or scheduling policy. The two Kubernetes files contain only ServiceAccount and RBAC objects; their diff changes list indentation…
Ote Binary Stdout Contract ✅ Passed PASS. The parent-to-HEAD diff changes only .ansible-lint and Ansible YAML/YML files. It changes no Go, OTE, Ginkgo, or test-entrypoint code. Searches of the changed files found no RunSpecs, suite …
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS — the pull request adds no Ginkgo or e2e test files. The changed paths are limited to Ansible configuration, tasks, handlers, defaults, and manifests. The diff adds no Ginkgo declarations or test…
No-Weak-Crypto ✅ Passed PASS. The pull request changes only Ansible/YAML files. The diff adds no MD5, SHA1, DES, 3DES, Blowfish, RC4, or ECB usage, no custom cryptographic implementation, and no secret or token comparison. T…
Container-Privileges ✅ Passed PASS. The PR changes no container or pod security settings. Added-line scans found no privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation: true. The two…
No-Sensitive-Data-In-Logs ✅ Passed PASS: The pull request adds no new logging of sensitive values. The changed output-related tasks only reformat existing debug or message content. Token and password operations retain no_log: true, i…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Description check ✅ Passed The pull request description clearly summarizes the syntax modernization, lint updates, retry behavior, validation results, and remaining work.
Linked Issues check ✅ Passed The title references USHIFT-7443, and the description states that the OpenShift CI robot confirmed the Jira issue is valid.
Out of Scope Changes check ✅ Passed The changes remain within Ansible syntax modernization, formatting, lint configuration, and the stated package-install retry update. The separately tracked USHIFT-7499 fix is explicitly excluded.
Title check ✅ Passed The title is concise and clearly identifies the main change: modernization of Ansible task syntax.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@sjug
sjug marked this pull request as ready for review September 8, 2026 16:16
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 8, 2026
@openshift-ci
openshift-ci Bot requested review from agullon and jogeo September 8, 2026 16:19
@openshift-ci

openshift-ci Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@sjug: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants