Skip to content

Stabilization: Fix for sshd_lineinfile template to comply with newer ansible versions - #15055

Merged
Mab879 merged 1 commit into
ComplianceAsCode:stabilizationfrom
teacup-on-rockingchair:sle_fix_new_ansible_sshd_version_compare-stabilization
Aug 26, 2026
Merged

Stabilization: Fix for sshd_lineinfile template to comply with newer ansible versions#15055
Mab879 merged 1 commit into
ComplianceAsCode:stabilizationfrom
teacup-on-rockingchair:sle_fix_new_ansible_sshd_version_compare-stabilization

Conversation

@teacup-on-rockingchair

@teacup-on-rockingchair teacup-on-rockingchair commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description:

  • Fix for sshd_lineinfile template to comply with newer ansible version

Rationale:

  • New ansible versions are more strict to comparing integers to strings. Package versions ending up as strings cannot be compared to integers in the ansible version function. Therefore ansible code in remediation fails, in cases like in sshd_lineinfile template.

Backport #15022 to stabiliziation

@teacup-on-rockingchair teacup-on-rockingchair added Ansible Ansible remediation update. backported-into-stabilization PRs which were cherry-picked during stabilization process. Update Template Issues or pull requests related to Templates updates. labels Aug 26, 2026
@teacup-on-rockingchair
teacup-on-rockingchair requested review from Mab879 and a lite review from Copilot August 26, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Ansible package applicability/version-check macro to be compatible with newer Ansible versions that are stricter about type handling during version comparisons. This is intended to prevent remediation failures (notably in consumers like the sshd_lineinfile template) when package fact fields (e.g., epoch) are not consistently typed.

Changes:

  • Adjust RPM epoch handling in ansible_pkg_conditional to coerce the epoch value to an integer before it is used to drive the conditional prefix construction.
  • Reduce the chance of type-related failures when evaluating the is version(...) test in newer Ansible releases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ggbecker ggbecker added this to the 0.1.82 milestone Aug 26, 2026
@Mab879 Mab879 self-assigned this Aug 26, 2026
@Mab879
Mab879 merged commit 7c46b68 into ComplianceAsCode:stabilization Aug 26, 2026
58 checks passed
@jan-cerny jan-cerny changed the title Backport to stabilization #15022 Stabilization: Backport to stabilization #15022 Sep 1, 2026
@jan-cerny jan-cerny changed the title Stabilization: Backport to stabilization #15022 Stabilization: Fix for sshd_lineinfile template to comply with newer ansible versions Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ansible Ansible remediation update. backported-into-stabilization PRs which were cherry-picked during stabilization process. Update Template Issues or pull requests related to Templates updates.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants