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 PM10/7/21
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.


---
- 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 PM10/7/21
to Ansible Project
I should add that this problem also happens with the following example playbook:


But, only for the first play in the playbook.

Anders Goncalves da Silva

unread,
Oct 7, 2021, 7:09:15 PM10/7/21
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:


Now the linter is working fine.
Reply all
Reply to author
Forward
0 new messages