Skip to content
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

proxmox inventory: fix for agent enabled #4910

Merged

Conversation

planeturban
Copy link
Contributor

@planeturban planeturban commented Jun 30, 2022

SUMMARY

Some (newer?) instances of proxmox uses "enabled=1" instead of just "1" in the agent config line. This fix adds ´agent_enabled´, checks if the first field is int; if so, set it to value. If not check if string equals "enabled=1" to set it ´agent_enabled´ to 1. Without this fix the inventory would be empty.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

community.general.proxmox

ADDITIONAL INFORMATION

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug inventory inventory plugin new_contributor Help guide this first time contributor plugins plugin (any type) labels Jun 30, 2022
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Jun 30, 2022
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Jun 30, 2022
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jun 30, 2022
@planeturban
Copy link
Contributor Author

After looking soberly at the code. Why not just skip the check if agent is enabled or not? It won't crash or anything, just leave an empty list.

ping @Thulium-Drake

@Thulium-Drake
Copy link
Contributor

Perhaps, though I'm not sure about the performance/running time hit if you 'just' ask for a host's interface addresses on a larger cluster. :-)

In my case, I don't use this functionality at all (I use LXC on my home system almost exclusively), I mostly want a list of hostnames and resolve them using DNS.

But, if the complexity isn't worth it (and it might not be), I'm all for simpler code

@felixfontein felixfontein changed the title Fix for agent enabled proxmox inventory: fix for agent enabled Jun 30, 2022
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Could you please add a changelog fragment? Thanks.

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-4 labels Jun 30, 2022
@github-actions
Copy link

github-actions bot commented Jul 4, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@planeturban
Copy link
Contributor Author

Perhaps, though I'm not sure about the performance/running time hit if you 'just' ask for a host's interface addresses on a larger cluster. :-)

I'll spin up ~100 vms and test. :)

In my case, I don't use this functionality at all (I use LXC on my home system almost exclusively), I mostly want a list of hostnames and resolve them using DNS.

But, if the complexity isn't worth it (and it might not be), I'm all for simpler code

I'll have a look at it this summer and make a new PR if there are none to little impact.

Co-authored-by: Felix Fontein <felix@fontein.de>
This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug inventory inventory plugin new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants