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
Historical behavior of ansible-lint is to assume that arguments received on the command line are either playbooks or roles.
Most people do not know that aspect and were surprised that the linter was giving errors or ignoring other file types, or that when given a directory it would not look inside it for any files that are recognizable.
As ansible-lint grew to be able to process a growing number of file types, i think it is time to address this historical problem and focus on a clear meaning for arguments: they would be only files and folders to process, without any assumed types. I would be assure that doing find foo.yml bar/ | xargs ansible-lint would be almost the same as just passing the same args to the linter directly.
The big dilemma that we have is related to the fact that ansible roles do not have any file that determines their existence. From Ansible point of view, any folder present inside Ansible include path is a role that can be imported, even if empty.
As the linter is run on not installed ansible content, we have to answer:
how we discover the roles within the linted repository?
how can we report an invalid role name when we have no file to report it against? -- i am not aware of any linters that can report folders instead of files as violations.
if we assume **/roles/* are roles, how can we lint them without having a file for each of them?
how to determine that a standalone-repository is a role? -- now we use presence of galaxy.yml file as the marked for that.
Maybe documenting the fact that single-role repositories must have a galaxy.yml file or the linter will not treat them as roles.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Historical behavior of ansible-lint is to assume that arguments received on the command line are either playbooks or roles.
Most people do not know that aspect and were surprised that the linter was giving errors or ignoring other file types, or that when given a directory it would not look inside it for any files that are recognizable.
As ansible-lint grew to be able to process a growing number of file types, i think it is time to address this historical problem and focus on a clear meaning for arguments: they would be only files and folders to process, without any assumed types. I would be assure that doing
find foo.yml bar/ | xargs ansible-lint
would be almost the same as just passing the same args to the linter directly.The big dilemma that we have is related to the fact that ansible roles do not have any file that determines their existence. From Ansible point of view, any folder present inside Ansible include path is a role that can be imported, even if empty.
As the linter is run on not installed ansible content, we have to answer:
**/roles/*
are roles, how can we lint them without having a file for each of them?Maybe documenting the fact that single-role repositories must have a galaxy.yml file or the linter will not treat them as roles.
Beta Was this translation helpful? Give feedback.
All reactions