-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
LXD inventory: Support virtual machines #3519
Conversation
I will fix the tests |
Hi @ElieDeloumeau, this looks very good. I am currently working on caching and will put it on hold until it has been taken over. Thanks Frank |
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.
Thanks for your contribution! Please add a changelog fragment.
Please note that all your changes must be backwards compatible, i.e. they must not break existing setups.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
@conloos how do you want to proceed? Is this PR ready for merging from your point of view? If you give your OK before tomorrow very early morning, I can merge it. I'll work on the 4.1.0 release very early tomorrow morning, if the PR doesn't make it in until then it has to wait for 4.2.0 in ~four weeks (of course it can get merged earlier, it just won't show up in a release before then). |
Hi Felix, I can't check everything today morning, including my tests. Greetings Frank |
@conloos it has been a couple of weeks, any progress so far? :) |
Hi @felixfontein, in the last weeks I develop the next Inventory AixBOMS. At the weekend i check the changes at the lxd plungin to be prepared for the next release. Thanks Frank |
Hi @felixfontein, everything is ok. But at the moment I am not able to get a working Unittest. But here all checks passed. So please ship it. Thanks Frank |
@conloos the problems you are experiencing with the unit tests are probably because you do not have https://galaxy.ansible.com/community/internal_test_tools installed where ansible-test will find it (I think it only looks for other collections in the same directory structure where the current collection is in). |
I use the Docker version: ansible-test units --docker -v |
If you run |
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #3900 🤖 @patchback |
* LXD 4.x compatibility (Containers and VMs) * add changelog fragment * update fixture * update plugin options * backwards compatible alias Co-authored-by: Felix Fontein <[email protected]> * Update changelogs/fragments/3519-inventory-support-lxd-4.yml Co-authored-by: Felix Fontein <[email protected]> * add lxd 4.0 requirement * filter for type of virtualization added. due to duplication in the namespace, "type" is not used as the keyword but "nature". * add type filter Since the first version of this inventory plugin only supports containers, a filter function was added to filter between containers and virtual machines or both. By default only containers are displayed, as in the first version of the plugin. This behavior will change in the future. * rename C(nature) to C(type) The term "nature" does not fit into the lxd namespace. Therefore i renamed nature to type. * update changelog fragment * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <[email protected]> * Apply suggestions from code review Co-authored-by: Felix Fontein <[email protected]> * rename typefilter to type_filter * fix tests with type_filter * Update plugins/inventory/lxd.py * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Frank Dornheim <“[email protected]@users.noreply.github.com”> (cherry picked from commit 8825ef4)
@ElieDeloumeau thanks for your contribution! |
@felixfontein @conloos Thanks for helping me 😃 |
* LXD 4.x compatibility (Containers and VMs) * add changelog fragment * update fixture * update plugin options * backwards compatible alias Co-authored-by: Felix Fontein <[email protected]> * Update changelogs/fragments/3519-inventory-support-lxd-4.yml Co-authored-by: Felix Fontein <[email protected]> * add lxd 4.0 requirement * filter for type of virtualization added. due to duplication in the namespace, "type" is not used as the keyword but "nature". * add type filter Since the first version of this inventory plugin only supports containers, a filter function was added to filter between containers and virtual machines or both. By default only containers are displayed, as in the first version of the plugin. This behavior will change in the future. * rename C(nature) to C(type) The term "nature" does not fit into the lxd namespace. Therefore i renamed nature to type. * update changelog fragment * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <[email protected]> * Apply suggestions from code review Co-authored-by: Felix Fontein <[email protected]> * rename typefilter to type_filter * fix tests with type_filter * Update plugins/inventory/lxd.py * Update plugins/inventory/lxd.py Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Frank Dornheim <“[email protected]@users.noreply.github.com”> (cherry picked from commit 8825ef4) Co-authored-by: Élie <[email protected]>
SUMMARY
Adds full compatibility for LXD 4.x. It allows to list containers and VMs
The plugin is already only compatible with LXD 4 (due to a call to
/1.0/networks/{interface}/state
), this PR adds requirement and VM supportISSUE TYPE
COMPONENT NAME
lxd inventory plugin
ADDITIONAL INFORMATION
I renamed "container" to "instance" (sed) and fixed some specific needs: L611, L632, L636, L649
My LXD instances:
Before (containers only):
After (containers and VM):