Skip to content

DRS Override - add state argument #2342

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Rogacz
Copy link

@Rogacz Rogacz commented Mar 5, 2025

SUMMARY

Added new state attribute with absent, disabled, enabled options to support missing functionality.
You can now remove existing DRS override or set DRS Override to disabled, which is different from manual.

Also added improvements:

  • Add name, uuid, moid, options to find VM in same standard as used in other modules, with optional folder, datacenter, use_instance_uuid arguments
  • Added alias vm_name to name argument to keep backward compatibility
  • Actually support check_mode as it was ignored previously
  • Properly handle editing and removal of existing DRS override entry
  • Expand description
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

vmware_drs_override

ADDITIONAL INFORMATION

At work, I need to create and remove DRS override for VMs, so here is an improved version of the module.

Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/150ee2f3859d4fa59078586284c5d5d6

⚠️ ansible-tox-linters CANCELED
build-ansible-collection FAILURE in 4m 39s
⚠️ ansible-test-cloud-integration-vcenter7_only-stable218 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-cloud-integration-vcenter7_2esxi-stable218 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-cloud-integration-vcenter7_1esxi-stable218_1_of_2 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-cloud-integration-vcenter7_1esxi-stable218_2_of_2 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-galaxy-importer SKIPPED Skipped due to failed job build-ansible-collection

Rogacz added 5 commits April 28, 2025 12:58
Add absent option, Switch to find vm based on standard options, Actually support check_mode
separate state argument with new disabled option, improve description
@Rogacz Rogacz force-pushed the drs_override_enchance branch from ef27490 to 31e30eb Compare April 28, 2025 10:59
Copy link
Collaborator

@ihumster ihumster left a comment

Choose a reason for hiding this comment

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

I am a little embarrassed by the presence of absent without present - I would add for compatibility and logic present with the same logic as enabled

@Rogacz
Copy link
Author

Rogacz commented Apr 28, 2025

I can just rename enabled to present. Options would be present/absent/disabled
My thought process was that both disabled and enabled are present, and didn't want to separate it to state=absent/present and enabled=true/false options.
But I understand it breaks a convention.

@Rogacz
Copy link
Author

Rogacz commented Apr 29, 2025

I've noticed that tests were skipped

@Rogacz
Copy link
Author

Rogacz commented Apr 29, 2025

It fails on something unrelated to this PR.
On content library tasks: The provided storage backing rw_datastore for library cfea863b-8db1-4b5f-a54d-8cfe64b9c9ed is inaccessible

@Rogacz
Copy link
Author

Rogacz commented Apr 30, 2025

recheck

@mariolenz
Copy link
Collaborator

I'm sorry, but my priority ATM is to make the collection work with the upcoming ansible-core 2.19 release (#2388 and #2391).

It turns out that this is harder than I originally expected. Please bear wit me 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants