Skip to content

25.9.0 run-once[play] cannot be ignored #4788

@MallocArray

Description

@MallocArray
Summary

After upgrading to 25.9.0, a playbook is showing a fatal violation for using strategy: free even though I have # noqa: run-once[play] on the same line which should ignore it. Was working with 25.5.0

Issue Type
  • Bug Report
OS / ENVIRONMENT
ansible-lint 25.9.0 using ansible-core:2.19.2 ansible-compat:25.8.1 ruamel-yaml:0.18.15 ruamel-yaml-clib:0.2.12
  • ansible installation method: pip, ansible-builder, or included in Azure DevOps agent
  • ansible-lint installation method: pip3
STEPS TO REPRODUCE

ansible-lint test.yml

---
- name: This is a playbook
  hosts: my_host_list
  gather_facts: false
  strategy: free  # noqa: run-once[play]
  tasks:
    - name: Debug
      debug:
        msg: "This is a test playbook"
Desired Behavior

The fact that this playbook uses strategy: free should be ignored and not return an error

Possible security bugs should be reported via email to [email protected]

Actual Behavior

Please give some details of what is happening. Include a minimum complete
verifiable example
with:

  • minimized playbook to reproduce the error
  • the output of running ansible-lint including the command line used
  • if you're getting a stack trace, also the output of
    ansible-playbook --syntax-check playbook
ansible-lint test.yml
WARNING  Listing 1 violation(s) that are fatal
run-once[play]: Play uses strategy: free
test.yml:1

Read documentation for instructions on how to ignore specific rule violations.

# Rule Violation Summary

  1 run-once profile:production tags:idiom

Failed: 1 failure(s), 0 warning(s) in 1 files processed of 1 encountered. Last profile that met the validation criteria was 'production'. Rating: 5/5 star

Metadata

Metadata

Assignees

No one assigned

    Labels

    newTriage required

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions