You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when running ansible-lint --fix the names of the handler tasks are correctly renamed to begin with upper case letter.
The Problem is that the notify: my handler remains unchanged, so the next run of the Playbook will fail.
Issue Type
Bug Report
OS / ENVIRONMENT
ansible-lint --versionansible-lint 24.2.0 using ansible-core:2.15.3 ansible-compat:4.1.11 ruamel-yaml:0.18.5 ruamel-yaml-clib:0.2.8
ansible installation method: OS package
ansible-lint installation method: pip
STEPS TO REPRODUCE
Create a playbook, that calls a handler but the name and notify of the handler is lowercase (see example playbook below)
Run ansible-lint --fix on the playbook
Run ansible-playbook playbook.yaml and it fails
---
- name: Test Playbookhosts: localhosttasks:
- name: Task that always changesansible.builtin.debug:
msg: "I always change!"changed_when: truenotify: my handlerhandlers:
- name: my handleransible.builtin.debug:
msg: "I never run :("
Desired Behavior
ansible-lint should uppercase the handler name and the notify call, so the playbook keeps working after running ansible-lint --fix
Possible security bugs should be reported via email to security@ansible.com
Actual Behavior
ERROR: The requested handler 'my handler' was not found in either the main handlers list nor in the listening handlers list
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
---
- name: Test Playbook
hosts: localhost
tasks:
- name: Task that always changes
ansible.builtin.debug:
msg: "I always change!"
changed_when: true
notify: my handler
handlers:
# Handler after ansible-lint --fix run
- name: My handler
ansible.builtin.debug:
msg: "I never run :("
$ ansible-playbook playbook.yaml
PLAY [Test Playbook]
TASK [Gathering Facts]
ok: [localhost]
TASK [Task that always changes]*******************
ERROR: The requested handler 'my handler' was not found in either the main handlers list nor in the listening handlers list
The text was updated successfully, but these errors were encountered:
Summary
when running
ansible-lint --fix
the names of the handler tasks are correctly renamed to begin with upper case letter.The Problem is that the
notify: my handler
remains unchanged, so the next run of the Playbook will fail.Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
ansible-lint --fix
on the playbookansible-playbook playbook.yaml
and it failsDesired Behavior
ansible-lint should uppercase the handler name and the notify call, so the playbook keeps working after running
ansible-lint --fix
Possible security bugs should be reported via email to
security@ansible.com
Actual Behavior
ERROR: The requested handler 'my handler' was not found in either the main handlers list nor in the listening handlers list
Please give some details of what is happening. Include a minimum complete
verifiable example with:
ansible-playbook --syntax-check playbook
The text was updated successfully, but these errors were encountered: