Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noqa doesn't work for run_once[play]: Play uses strategy: free (warning) playbook.yml:1 #2932

Closed
donvipre opened this issue Jan 24, 2023 · 0 comments · Fixed by #2952
Closed
Assignees
Labels

Comments

@donvipre
Copy link

Summary

In below playbook the ansible-lint playbook.yml throws the warning run_once[play].
It appears to detect the linter exception on line 1.
Tried the noqa statement on line 1 as well.

playbook looks like the following:

---
# system update
- name: Play - system update
  hosts: all:!localhost
  strategy: free # noqa run_once[play]
  serial: 10
  roles:
    - role: 'ansible-role-system-update'

Output of ansible-lint:

ansible-lint system_update.yml 
WARNING  Overriding detected file kind 'yaml' with 'playbook' for given positional argument: system_update.yml
WARNING  Listing 1 violation(s) that are fatal
run_once[play]: Play uses strategy: free (warning)
system_update.yml:1

You can skip specific rules or tags by adding them to your configuration file:
# .config/ansible-lint.yml
warn_list:  # or 'skip_list' to silence them completely
  - experimental  # all rules tagged as experimental

                   Rule Violation Summary                   
 count tag            profile rule associated tags          
     1 run_once[play]         idiom, experimental (warning) 

Passed with production profile, 5/5 star rating: 0 failure(s), 1 warning(s) on 1 files.
Issue Type
  • Bug Report
OS / ENVIRONMENT

Fedora 37

ansible-lint --version
ansible-lint 6.10.0 using ansible 2.14.1
  • ansible installation method: OS package Fedora
  • ansible-lint installation method: OS package Fedora
STEPS TO REPRODUCE

See above in the introduction.

Desired Behavior

# noqa behind the strategy: free should ignore the warning.

Actual Behavior

See above in the introduction.

@donvipre donvipre added bug new Triage required labels Jan 24, 2023
@audgirka audgirka self-assigned this Jan 25, 2023
@ssbarnea ssbarnea removed the new Triage required label Feb 1, 2023
@audgirka audgirka linked a pull request Feb 1, 2023 that will close this issue
@audgirka audgirka closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants