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
Inventory does not meet host_list/script requirements (Ansible 2.7.1) #48859
Comments
Hi @mil1i, thank you for submitting this issue! |
Files identified in the description: If these files are inaccurate, please update the |
This was purposefully implemented in #46766 to provide additional information when running ansible with If you have further questions please stop by IRC or the mailing list:
|
IMO, it's not additional information. If it said why requirements weren't met, or even just had a link to what the new requirements are, it might be useful. |
no new requirements, its just giving you info on WHY a plugin was skipped, there are many reasons, in this case it is because it didn't pass the 'verify' phase for the plugin, which should have the specific requirements in it's own documentation (see ansible-doc -t inventory ) |
I see nothing in the message that says WHY, just WHAT, and that it does poorly. |
The WHY is that requirements were not met, a parsing error can be another reason and that will give a specific exception/tracekback. Each plugin has it's own requirements and verification, in many cases it does not have to do with file contents but nature of the file itself. Using -vvv you should see at least one of the reasons for requirements not being met: |
-vvv shows nothing more than the -v message. Neither does -vvvvvv. Looks to me like a bug for an alert to a non-existent issue, at least for ini based inventories. |
I gave that as one example, there are other reasons, not all of them show the specific info, it depends on the specific plugins. The ini inventory is not causing this, directly, you are seeing it because 2 other plugins get 'checked' before the ini accepts the file. |
Whatever those plugins that get |
its an incremental improvement, that part of the code doesn't know the reason, just that the plugin rejected it in verification phase, it is more info than you got before, in which you didnt know that it was rejected in that phase |
Since everything runs for both myself the original poster, it doesn't look like an improvement. |
Very confusing, indeed. |
I also found this message confusing. |
I agree that his "error" message is not helpful, at least there should be a link to the specific chapter in documentation containing host_list requirements. My playbooks run without problems and I have no clue why exactly this message occurs and how to fix the problem. |
So maybe those plugins should better trigger a message (or not) as they possess any useful info? |
I agree that the message is confusing. I had no idea what "host_list requirements" are, or what plugin it was talking about. After reading the Inventory Plugins docs, I did figure out a workaround. If you configure Ansible with just the inventory plugin you are using, you avoid warnings about files not meeting the requirements of the other plugins. [inventory]
# avoid "did not meet _ requirements" warnings when using -v
# see https://github.com/ansible/ansible/issues/48859
enable_plugins = ini |
Plugins should also add more info on higher verbosity levels see ansible#48859
How do you know WHICH plugin generated the message? That at least would be a hint. I reduced my plugin list down to one (yaml), and still get the message, but the inventory seems to be parsed fine. |
the message has always had the plugin name, host_list/ini/script/yaml/etc , the new one now puts it at the start of the message instead of the middle. |
No it doesn't. It has the file being complained about at the start, not the name of the plugin doing the complaining.
I see nothing that looks like a plugin name. As @leedm777 suggested, limiting the inventory enabled plugin to just ini eliminates the message, so even the hint of the file name is not correct. Given that enable_plugins = ini stops the message, it looks to me like some other inventory plugin is incorrectly getting the ini file as input, and complaining about it, with an inadequate error message. How is this not a bug? |
@alanbantuit read the new message from the PR above, that is the one that puts the plugin at the start As from your example 'host_list' is the plugin, which i agree is not clear, which is why i changed it to be at the start of it. |
So what do bros? What is plugin "host_list"?? I added
to my conf but same message |
This seems to be one type of bug that doesn't look like a bug to the author but that obviously causes problems for ordinary users. Maybe the wording should be clearer that it is not an error, and the plugin name should be in quotes, as in
|
The text has already changed, #49080, also i bumped up at the verbosity it shows at. To clarify this is NOT a warning nor an error, just an informational message that appears when using the verbosity setting. None of the messages on increased verbosity are errors, those are always displayed, you might get more information about an error but errors and warnings have their own display facilities. |
hmm true, warnings are in purple and errors in red i still don't know what the message is about though :D |
It seems to me that if some code is emitting informational messages about inputs not passing a test, other code that tests the same input should emit an informational message about that input passing its test. That would be consistent and more informative. Here it looks like the input passes some test somewhere, but we don't know where. |
when the test passes you see the plugin 'processing' the input, this message was meant to give some information on why plugins didn't attempt to do so |
Funny that this issue is the first that pops up after searching for the error messages stated in the description. Because that is what I had to do to find a solution after comparing my inventory list with the documentation examples finding no oddities. I have respect for the Ansible team and I'm grateful for their work, but this is not a cool change @bcoca it's confusing and unnecessary because it leaves us with questions rather than answers. If Ansible have a problem with my input files, I want it to go hard exit, tell me exactly what the problem is so I can fix it and go on with the task. |
the way inventory plugins work is that we have a list of them, given a source we go through the list and see if that source matches the plugin and then if it can be parsed, you will get a warning (toggle to make it an error) if no plugin is able to read a file. i.e given an hosts.ini, first we try 'host_list' (which takes inline host string Again, this was never an error or warning, it was one more of the many messages you get when running verbose. |
Now that I have read this discussion, I understand what these messages are about. But it's worth noting that I spent maybe 20 minutes researching and reading this (and comments indicate that it was a concern for many more users.) If every message in verbose output was so worrisome to cause this sort of response, no one would ever get anything useful done with Ansible and/or the verbose mode would be considered useless. The problem for me was that using "-v" or "-vv" reports the plugins that did NOT work, but does NOT indicate which one DID work. You have to go full "-vvv" to see which plugin worked. Maybe just making the plugin success message always display at the same verbose level as the plugin failure messages would avoid this confusion. |
@flatrocks again, look at PR above, it did just that |
I have to say that I find the message confusing too, this being the reason why I ended up reading this bug. This is more of a debugging level message which still prints on V=1 which is not ok. The irony is that these messages are printed but you have no idea which plugin was used to load the hosts file in the end, if it was loaded at all. I think that the bug is genuine and underlines several issues:
|
I am getting "Could not match supplied host pattern, ignoring: 'all'" after these messages so clearly something is not working somewhere but there is no information about how to find this or fix it. Definitely needs a better error message. |
Can we know what type of requirements that we need to match so that we do not get this info message? |
The new message in the fixing PR commit is: @bcoca |
Yes, “it’s” is the contraction of “it is”, not the possessive of “it”. The possessive is “its”.
From: "sremy" <notifications@github.com>
To: "ansible/ansible" <ansible@noreply.github.com>
Cc: "Alan Brenner" <alan@abcompcons.com>, "Comment" <comment@noreply.github.com>
Sent: Friday, January 4, 2019 7:05:19 AM
Subject: Re: [ansible/ansible] Inventory does not meet host_list/script requirements (Ansible 2.7.1) (#48859)
The new message in the fixing PR commit is:
display.vvv("%s declined parsing %s as it did not pass it's verify_file() method" % (plugin_name, source))
[ https://github.com/bcoca | @bcoca ]
Shouldn't it be " its " instead of " it's "?
[ https://github.com/ansible/ansible/blob/devel/lib/ansible/inventory/manager.py#L281 | https://github.com/ansible/ansible/blob/devel/lib/ansible/inventory/manager.py#L281 ]
By the way, thanks for this clarification.
—
You are receiving this because you commented.
Reply to this email directly, [ #48859 (comment) | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AAigO-Cbc5kdXQNhBL8mpkefzwoemKN9ks5u_0N_gaJpZM4YoJPK | mute the thread ] .
|
Please someone tell me if after reading all of this I finally have it right in my head. There are several different plugins for reading the inventory (I use yaml). All this thing is trying to tell me is that it did not pass the inventory check for the ini style, script, or whatever other one? |
@sgutermann Yes, it's trying to tell you that it did not pass the inventory check for ini script (because it's using the yaml one instead. If in the ansible.cfg you just used:
Then those "informational notices" would go away. I agree that it's not clear what they are for, but after some trial and error, I was able to get rid of those "notices". I use the ini format for everything, and don't run "one offs" ...so I just using ini, and tada...no more irritating messages. |
what is this error, I am a newbie who want have a try of Ansible, But it rasied a error, which I don't know how to resolve..... |
.../dotfiles/.provisioning/hosts did not meet host_list requirements, check plugin documentation if this is unexpected .../dotfiles/.provisioning/hosts did not meet script requirements, check plugin documentation if this is unexpected see ansible/ansible#48859
I also keep getting this, despite putting
in my |
@bcoca , clarifying the message as @ssbarnea suggests would help immensely. The message in the PR is not quite as clear, and the suggestion would help prevent users from wanting to look under the hood to discover why something is being "declined" due to being "unverified," rather than being "skipped" for another inventory plugin. The message should also identify the plugin as an inventory plugin as suggested. Also, thanks for providing the info message in the first place, and setting the verbosity to match the level of the inventory plugin that's actually loaded. I did get to learn something today after wondering "what did I do wrong?" :) |
With 2.7.8 I get this message:
For me it was not obvious that host_list and script were the actual names of plugins. I think it would be clearer as:
|
SUMMARY
After upgrading to ansible version 2.7.1 using Homebrew on macOS, I receive the following informational warning when running playbooks with the verbose option.
My playbooks still run and complete without issue. I have never had any issues with my hosts file in the past, nor does this message display with ansible 2.7.0.
ISSUE TYPE
COMPONENT NAME
host_list plugin (inventory file)
script plugin (inventory file)
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
macOS High Sierra 10.13.6
STEPS TO REPRODUCE
Switch to ansible version 2.7.1, run any playbook with verbose enabled.
EXPECTED RESULTS
ACTUAL RESULTS
Playbooks still run and complete without issue. But ansible's verbose informational message suggests something is wrong with my inventory file with the latest version available (on Homebrew).
The text was updated successfully, but these errors were encountered: