refactor(roles): detect check mode only with ansible_check_mode #271
Notifications
Due Date
No due date set.
Blocks
Reference: Mortis/Kamino#271
Reference in new issue
Block a user
Spec: Role interface and semver: output facts, handler names, dropped platforms and internal roles, resolution comment, point 9.
What
The only allowed check-mode guards are
check_mode: falseon read-only probes andwhen: not ansible_check_mode, and--checkis the supported preview. On ansible-core 2.22.0 a play-levelcheck_mode: trueleavesansible_check_modeFalse (checked on 2026-11-20), so the roles that use it already misbehave under that keyword;ufwalone works around it with a skipped probe task.ufw: replace each probe (tasks/sysctl.yml,tasks/orphan_rules.yml,tasks/service_rules.yml: thecommand: "true"task and theset_factthat readsis skipped) withansible_check_mode, and remove the comments that explain the probe. Update the README line that describes it.--check; a play-levelcheck_mode: trueis not supported (it does not setansible_check_mode)." In a public role's README it goes in the Notes; in an internal role's README it goes in the nearest fitting section (no Notes heading is added for it).breaking_changesfragment forufw: a play-levelcheck_mode: trueis no longer detected.Done when
ufw, including its check-mode scenarios.is skippedprobe for check mode remains underroles/.Not in scope
Adding the molecule
checkstep (test(roles): run molecule's check step before and after converge). Either can land first; this one leaves that issue nothing to decide aboutufw.Body edited on 2026-11-20 (final validation round of the map, #87 (comment)): decision 7: the check-mode line goes in the Notes of each public role's README and in the nearest fitting section of an internal role's README (no Notes heading is added for it).