New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor fqcn to recommend use of canonical names #2604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule suggests to use community.general.system.ufw
instead of community.general.ufw
. This is just plain wrong and dangerous!
@felixfontein We will discuss about at Fest, as that is very good opportunity to meet with most of the parts involved. We are not in a pressure to push this so we will look at all possibilities. All I know now, is that we do want to "suggest a single form of calling a module at one point in time", for consistency, also for UX when using search or auto-complete. If I remember correct, likely that 99% of module affected are inside community.general collection, or other community collections. Use of "deep" modules is quite rare outside AFAIK. In fact I could try to get some stats on this myself as I already had a folder will all collections that published a version in the last 12 months. |
Just chiming in that I had no clue there were even modules with such deep structures. I've only ever used names as deep as As an end user, it seems weird that anything would recommend deeper module names (it just seems wrong to me). I still don't even think it's an issue to use non-FQCN, because again—as an end user, that's one of the nice things about Ansible, 99% of the module I use don't have to have a FQCN to work ;) (But I understand that the FQCN ship has sailed and people who like short names will just have to squelch lint in that case, as I already have on any of my older projects. I use FQCN on newer projects, but will probably only slowly update older playbooks just because there's no perceived benefit to me doing so, regardless of micro-optimizing internal Python redirects.) |
Not sure if this will ruin your day but presence of FQCN will likely become mandatory for uploading content to galaxy, the main reason being that this will prevent upload of broken content (missing dependencies). Only by using FQCN we can know that the used modules are mentioned as dependencies, dependencies that do exist and are installable. To give an example if you have collection |
For new projects it's definitely not an issue; it's just older projects where the time to convert everything is not a few seconds. It would be nice if there were a command like I assume roles (standalone) won't be affected by the fqcn-galaxy-requirement in Galaxy NG? |
a5653c3
to
9bd43ec
Compare
9bd43ec
to
ce67211
Compare
I modified the implementation to temporary prevent it from raising |
Thanks for adding the exceptions for c.g and c.n! |
There seems to be something really wrong with this PR. After upgrading ansible-lint all may plays broke with errors like:
And none of the suggestions work. If I disable ansible-lint in my pipelines everything runs fine. What's the purpose of adding new breaking validation rules that still runs fine with ansible? |
@erikgb I guess this is about the modules in https://github.com/TerryHowe/ansible-modules-hashivault. How did you install these? This might be very relevant to reproduce the problems you are experiencing. (Both modules in |
@felixfontein Thanks for your reply. Ansible Modules Hashivault is installed with pip in our in-house ansible image. We have created an image that is used for running various Ansible plays in GitLab-pipelines. Any additional info needed? |
With that information it is easily reproducable, for example in a new container pip install ansible-modules-hashivault ansible-lint
cat > playbook.yml << EOF
---
- name: Test
hosts: localhost
tasks:
- name: Test
ansible.legacy.hashivault_secret:
secret: giant
data:
foo: foe
fie: fum
EOF
ansible-lint playbook.yml
pip install git+https://github.com/ansible-community/ansible-lint.git#egg=ansible-lint
ansible-lint playbook.yml It happens with both with the latest released version and with the current development version. |
Note that It would probably help a lot more if these hashivault modules would be shipped as a collection... |
In any case, with the above playbook, When in the playbook |
Well, and while debugging this I realized that this is totally unrelated to the hashivault modules :) Simply use |
#2634 fixes this. |
Thanks a lot, @felixfontein! I really appreciate it! |
Closes: #2572