Skip to content

Why does my tasks file (under tasks/do_sth/do_sth.yaml) say "block is a required property"? #3304

Answered by fxlv
blv-brunoneyra asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not an expert on this, and, perhaps, your case is/was different, but I also hit the similar/same issue today and this was one of very few google hits for me, hence I will make a comment on how I solved it.

I experienced warning from ansible-lint:

schema[tasks]: 'block' is a required property

Looking at ansible-lint docs I learned that ansible-lint considers directory structure to figure out what the purpose of the file is.

I had my playbook as ansible_dir\tasks\stuff.yml which the linter complained about as it assumed it is just a list of tasks, but for me, it was a playbook.
Once I changed directory structure to be ansible_dir\playbooks\stuff.yml the linter was happy and so was I.

I…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@pythoninthegrass
Comment options

Answer selected by blv-brunoneyra
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants