1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

12 commits

Author SHA1 Message Date
Jeffrey van Pelt
71745b8024
Added conditional to only collect qmpstatus on qemu VMs (#4816)
* Added conditional to only collect qmpstatus on qemu VMs

* Processed feedback, added changelog

* Initial change to unit tests

* Made Sanity tests happy again

* Missed a function call, removed superfluous function

* Derp, no need to mock get_vm_status anymore

* Added detail checks whether hosts are mapped to the paused/prelaunch groups

* Fix sanity check

* Processed feedback

* Processed feedback - noqa
2022-06-11 13:46:17 +02:00
Ilija Matoski
b556b142ec
Proxmox Inventory: added new statuses for qemu (#4723)
* added new statuses for qemu

* added document fragment

* lint fixes

* replaced f strings with %

* move the qmpstatus for qemu to a dedicated group

* added documentation to explain the new addition

* update changelog fragment to reflect the change correctly

* update changelog fragment to reflect the change correctly

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* added a switch to get the qemu extended status

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* groups created when qemu_extended_statuses is true and added tests to make sure they are there

* added test to make sure the groups are not present when qemu_extended_statuses is false

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-04 09:15:02 +02:00
Emmanuel Benoît
761171b532
Proxmox inventory filters (#4352)
* Proxmox inventory plugin - Initial implementation of filters

  * This is an attempt at implementing something that would satisfy
    issue #3553
  * A rather massive code rewrite was needed as adding the host to the
    inventory, setting its variables and adding it to various groups
    used to be done as soon as the information became available. This is
    not possible when it is not known whether the host should be added
    to the inventory before all data has been gathered.
  * The code for both LXC containers and Qemu VMs was refactored into a
    single loop.
  * Helper functions to generate group and fact names were added.

* Proxmox inventory plugin - Warnings for filter errors

  * When an error occurs while compositing a filter's value and strict
    mode is disabled, display a warning.

* Proxmox inventory plugin - Fixed pool groups building

  * Hosts that were excluded by the host filters were still being added
    to pool groups, causing errors.

* Proxmox inventory plugin - Refactoring

  * Split off the VM/container handling code from the
    `_populate()` method
  * Split off pool group attribution from the `_populate()` method

* Proxmox inventory filters - Changelog fragment

* proxmox inventory - Simplify _can_add_host() method

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-03-15 12:22:43 +01:00
Jeffrey van Pelt
32e9a0c250
Proxmox inventory: Added snapshots fact (#3044)
* Added snapshots fact

* Added changelog

* Made linter happy again

* Processed feedback

* Fix changelog type

* Punctuation ;-)

* Punctuation ;-), take 2
2021-07-22 22:55:07 +02:00
Ajpantuso
111c5de550
proxmox inventory - fix parsing for offline nodes (#2967)
* Initial commit

* Adding changelog fragment

* Applying initial review suggestions
2021-07-10 16:39:51 +02:00
Rémy Keil
f44300cec5
add inventory plugin unit test test_verify_file (#2773)
* add inventory plugin unit test `test_verify_file`

* fix typos in `test_verify_file_bad_config` unit test
2021-06-10 22:05:04 +02:00
Ilija Matoski
ca48917b4f
inventory/proxmox: Added some cases for unsupported network interface and multi-nic and unsupported guest error (#2263)
* added some cases for unsupported network interface and multi-nic without IP addresses

* added changelog fragment

* lint fixes and added option for ansible_host setting

* added description about the new option

* lint fix too long line

* Update changelogs/fragments/2259-proxmox-multi-nic-and-unsupported.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/inventory/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/inventory/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/inventory/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Added CommandDisabled

* refactored to code and added a test case where an interfaces doesnt have a mac address or is invalid to reset it to 00:00:00:00:00:00

* Update tests/unit/plugins/inventory/test_proxmox.py

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* Update tests/unit/plugins/inventory/test_proxmox.py

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* mac-address is set to None instead of 00:00:... when not defined

* changed None to empty string for mac-address

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-04-21 19:52:45 +02:00
Jeffrey van Pelt
123b5a9a3c
Proxmox inv fix agent string parsing (#2245)
* Added handling for commas in the agent field for agent configuration

* Removed test statement

* Added changelog fragment

* Fixed spelling on fragment :-)
2021-04-17 10:08:41 +02:00
Ajpantuso
8ab356520d
Proxmox_Inv: Adding agent network interaces fact (#2148)
* Added agent network interaces fact

* Adding changelog fragment

* More concise looping over interfaces

* Adding unit test case for agent interfaces

* Correcting whitespace issue

* Commented new dummy json returns with corresponding method
2021-04-12 22:24:33 +02:00
Ajpantuso
d0bb74a03b
Allow tags strings containing commas in proxmox inventory plug-in (#1949)
* Included explicit parsing for proxmox guest tags and updated corresponding unit test with tags key

* Including changelog fragment for PR 1949

* Removed ellipsis from test

Proxmox only permits periods when surrounded by alphanumeric characters

* Corrected punctuation for changelog entry

Co-authored-by: Felix Fontein <felix@fontein.de>

* Allowing tags string to contain commas

* Incorporated new parsed tags fact with bugfix

* Correcting whitespace issues

* Update changelogs/fragments/1949-proxmox-inventory-tags.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/inventory/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/1949-proxmox-inventory-tags.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-03-11 22:08:11 +01:00
Krzysztof Dąbrowski
c488cb1dd3
proxmox: ignore QEMU templates altogether (#1185)
* proxmox: ignore QEMU templates altogether

* add changelog fragment

* add test case

* Update changelogs/fragments/1185-proxmox-ignore-qemu-templates.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-30 19:51:49 +01:00
Jeffrey van Pelt
73be912bf7
New inventory module: Proxmox (#545)
* This commit adds proxmox inventory module and proxmox_snap for snapshot management

* Fixed pylint errors

* Missed this one..

* This should fix the doc errors

* Remove proxmox_snap to allow for single module per PR

* Changes as suggested by felixfontein in #535

* Reverted back to AnsibleError as module.fail_json broke it. Need to investigate further

* Made importerror behave similar to docker_swarm and gitlab_runner

* FALSE != False

* Added myself as author

* Added a requested feature from a colleague to also sort VMs based on their running state

* Prevent VM templates from being added to the inventory

* Processed feedback

* Updated my email and included version

* Processed doc feedback

* More feedback processed

* Shortened this line of documentation, it is a duplicate and it was causing a sanity error (> 160 characters)

* Added test from PR #736 to check what needs to be changed to make it work

* Changed some tests around

* Remove some tests, first get these working

* Disabled all tests, except the one I am hacking together now

* Added mocker, still trying to figure this out

* Am I looking in the right direction?

* Processed docs feedback

* Fixed bot feedback

* Removed all other tests, started with basic ones (borrowed from cobbler)

* Removed all other tests, started with basic ones (borrowed from cobbler)

* Removed all other tests, started with basic ones (borrowed from cobbler)

* Removed init_cache test as it is implemented on a different way in the original foreman/satellite inventory (and thus also this one)

* This actually passes! Need to check if I need to add asserts as well

* Made bot happy again?

* Added some assertions

* Added note about PVE API version

* Mocked only get_json, the rest functions as-is

* Fixed sanity errors

* Fixed version bump (again...) ;-)

* Processed feedback
2020-08-21 13:16:59 +02:00