Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
Help figuring linter fail with conflicting action statements: hosts, tasks
332 views
Skip to first unread message
Anders Goncalves da Silva
unread,
Oct 7, 2021, 6:56:44 PM
10/7/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hello. I haven't been able to find a satisfactory solution to the problem I am having.
The linter throws the following error:
[parser-error] conflicting action statements: hosts, tasks
I am running ansible-lint 5.2.0 using ansible 2.11.5.
This is the playbook (
https://docs.microsoft.com/en-us/azure/developer/ansible/vm-configure?tabs=ansible#clean-up-resources
):
---
-
hosts
:
localhost
tasks
:
-
name
:
Deleting resource group - "
{{
name
}}
"
azure_rm_resourcegroup
:
name
:
"
{{
name
}}
"
state
:
absent
register
:
rg
-
debug
:
var
:
rg
Any help would be greatly appreciated.
Thank you.
Anders.
Anders Goncalves da Silva
unread,
Oct 7, 2021, 7:00:19 PM
10/7/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
I should add that this problem also happens with the following example playbook:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#playbook-execution
But, only for the first play in the playbook.
Anders Goncalves da Silva
unread,
Oct 7, 2021, 7:09:15 PM
10/7/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
The error seems to stem from the fact that I had it in a folders called tasks instead of a folder called playbook:
https://github.com/ansible-community/ansible-lint/issues/1471
Now the linter is working fine.
Reply all
Reply to author
Forward
0 new messages