Replies: 1 comment
-
I agree with the author of the topic and propose to combine all these modules into requested rule:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using the
import_tasks
module, I think that requiring a name field above everyansible.builtin.import_tasks: <sometaskfile.yml>
is gratuitous. E.g., I commonly have a file that includes multiple import_tasks lines:and I see messages such as:
Adding names to the above needlessly clutters the file and obscures my intent.
According to the docs, I can disable
name[missing]
messages for all tasks/modules: https://ansible-lint.readthedocs.io/rules/name/, but I still want to require names for tasks which use other modules, just not for theimport_tasks
module.Further, when I explicitly say that I don't want a specific module to be used with
name
, I want a rule to enforce that it is never used for that module. I.e., It should be a linting error to usename
withansible.builtin.import_tasks
when I explicitly disablename
for all uses of theansible.builtin.import_tasks
module.Finally, I also anticipate situtations in which I write my own modules which are similarly self-descriptive (and for which I don't want to use a
name
field). So I'm not suggesting a hard-coded exception for theansible.builtin.import_tasks
module specifically. I just want to be able to enforce the absence/presence of thename
field on a per-module basis for any specified module.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions