# Overriding detected file kind 'yaml' with 'playbook' for given positional argument

**URL:** <https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489>\
**Category:** Ansible Project\
**Tags:** ansible-lint\
**Created:** [December 22, 2022, 10:40am UTC](https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489 "2022-12-22T10:40:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [December 22, 2022, 10:40am UTC](https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489/1 "2022-12-22T10:40:02Z")

</div>

Hi Team,

I am facing below error while doing ansible-lint, Any help would be appreciated

command: **ansible-lint test.yaml**

**Overriding detected file kind ‘yaml’ with ‘playbook’ for given positional argument**

Thanks,  
Raj

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [December 22, 2022, 11:52am UTC](https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489/2 "2022-12-22T11:52:50Z")

</div>

That isn’t an error. It’s just information: the yaml file is being treated as a playbook.

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [December 22, 2022, 12:16pm UTC](https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489/3 "2022-12-22T12:16:08Z")

</div>

It is a warning , can you please tell me how to avoid this?

**WARNING Overriding detected file kind ‘yaml’ with ‘playbook’ for given positional argument: my\_test.yml**

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [December 22, 2022, 12:40pm UTC](https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489/4 "2022-12-22T12:40:54Z")

</div>

Not possible to omit generating those messages, although you could say

$ ansible-lint […] 2\>/dev/null

If the positional argument were, say, a group\_vars file and it was being linted as if it were a playbook, then “WARNING …” would clearly make sense. Or if you didn’t intend “my\_test.yml” to be linted as a playbook, then you’d be glad for the warning.

As it is, since you can’t pick which lintable schema to use on a given file (at least not from --help’s output, or the missing man page), I’ll stand by my original statement: it’s an informational message that happens to begin with the text “WARNING”. That’s just my opinion, but ansible-lint is extremely opinionated after all.

---

<div class="post-metadata">

**Author:** ![Will\_McDonald](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@Will\_McDonald](https://forum.ansible.com/u/Will_McDonald)\
**Post date:** [December 22, 2022, 1:00pm UTC](https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489/5 "2022-12-22T13:00:25Z")

</div>

There’s a little more info on why this behaviour occurs here: [https://github.com/ansible/ansible-lint/issues/1398](https://github.com/ansible/ansible-lint/issues/1398)

The shell return value is accurate regardless:

[wmcdonald@fedora tests]$ ll  
total 4  
-rw-r–r–. 1 wmcdonald wmcdonald 143 Dec 22 12:55 test1.yaml  
[wmcdonald@fedora tests]$ cat test1.yaml

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [December 26, 2022, 7:11am UTC](https://forum.ansible.com/t/overriding-detected-file-kind-yaml-with-playbook-for-given-positional-argument/37489/6 "2022-12-26T07:11:41Z")

</div>

Thank you all for your response
