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

virtualmachine: Add support for Disk Encryption Set parameter #1316

Closed

Conversation

lm-sig
Copy link

@lm-sig lm-sig commented Nov 1, 2023

Fixes #425

Supersedes #1217

SUMMARY

I had a requirement to have virtual machines with disks (both OS and data) that used encryption. The VM module did not support provisioning or attaching any disk type with encryption enabled.

Fixes #425

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_vm_virtualmachine

ADDITIONAL INFORMATION

A customer may set an Azure policy that requires VMs to have disks with encryption. If you attempt to provision a virtual machine with disks without encryption your request will fail.

This change will support both encrypted or unencrypted disks. Currently it requires you to provide the full Azure resource ID for the data encryption set ID.

@lm-sig
Copy link
Author

lm-sig commented Nov 1, 2023

There are currently (2023-11-01) no merge conflicts and no outstanding review issues. Please review as soon possible. Thanks.

* Add required description to document

* new change for required_if

* Add missing ']'
Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

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

Please add test cases for the newly added parameters, thank you!

plugins/modules/azure_rm_virtualmachine.py Show resolved Hide resolved
plugins/modules/azure_rm_virtualmachine.py Outdated Show resolved Hide resolved
@Fred-sun Fred-sun added medium_priority Medium priority work in In trying to solve, or in working with contributors enhancement New feature or request labels Nov 3, 2023
Fred-sun and others added 18 commits November 6, 2023 15:41
* Delete unnecessary required sets

* Modify azure_rm_virtualnetworkgaway.py

* restore azure_rm_mysqlfirewallrule.py change
* Bump version to v1.19.0

* The storage_profile is not a required parameter for creation

* update doc

* update doc

* restore azure_rm_galleryimageversion.py changes

* update doc

---------

Co-authored-by: xuzhang3 <xuzhang3@microsoft.com>
* Add auth_mode to azure_rm_storageblob

Add the parameter `auth_mode` to the
`azure_rm_storageblob` module, making it possible to create blobs
without using access keys.

* Fix sanity tests

* Add integration tests

Test using auth_mode='login' for storage blobs.
This has been tested on a machine with MSI.

* Remove spaces around equal sign
)

* Add encryption to azure_rm_galleryimageversion

Add the parameter `encryption` to `target_regions` of the
`azure_rm_galleryimageversion` module, making it possible to create
encrypted images.

Fixes ansible-collections#1290

* Fix documentation

* Add disk encryption to gallery image version tests

Add the usage of disk encryption to all regions in the tests of the
module azure_rm_galleryimageversion.

This required a fix, moving the deprecated managed_image to
storage_profile.source_image instead.
* Add features to azure_rm_galleryimage

Add the parameter `features` to the
`azure_rm_galleryimage` module, making it possible to create VMs with
Trusted Launch from these images.

* Add integration tests

Switch gallery image definition to Hyper-V
generation V2 and enable TrustedLaunch.
* add ansible-core v2.16

* add v2.16

* ignore for v2.16

* ignore for v2.16

* ignore for v2.16
* migrate to msgraph

* migrate to msgraph

* migrate to msgraph

* migrate to ms graph API

* ad group info

* app info and group info

* migrate to msgraph

* spn msgraph

* migrate AD to MS graph

* Migrate AAD API to MSGraph API for ServicePrincipal, User and Password (ansible-collections#1280)

* migrate sp and fix application

* migrate azure_rm_adserviceprincipal.py

* migrate azure_rm_aduser_info.py

* migrate azure_rm_adpassword_info.py

* migrate azure_rm_aduser.py

* Migrate azure_rm_adpassword.py and fix azure_rm_adpassword_info.py

* update azure_rm_adserviceprincipal.py

* update azure_rm_adserviceprincipal_info.py

* update azure_rm_aduser.py

* update azure_rm_aduser_info.py

* update azure_rm_adpassword.py

* update azure_rm_adpassword_info.py

* update azure_rm_aduser.py

* update azure_rm_adpassword.py

* update azure_rm_adpassword_info.py

* update azure_rm_adpassword.py to use add_password and remove_password

* update azure_rm_aduser_info.py to add select

* update azure_rm_aduser.py to add select

* update code

* update code

* update code

* update code

* update code

* update code

---------

Co-authored-by: neil-yechenwei <v-cheye@microsoft.com>

* cli auth

* auth with CLI

* Get the existing user after create (ansible-collections#1286)

Co-authored-by: neil-yechenwei <v-cheye@microsoft.com>

* Add advanced query filter to get the existing user by list (ansible-collections#1287)

Co-authored-by: neil-yechenwei <v-cheye@microsoft.com>

* get app by app id

* fix lint

* fix sanity

* fix sanity

* fix sanity

* fix sanity

* deprecate tenant ID

* Mark the property for deprecating and renaming property (ansible-collections#1294)

* Mark the property for deprecating and renaming property

* update code

* update code

---------

Co-authored-by: neil-yechenwei <v-cheye@microsoft.com>

* deprecate tenant ID

* msgraph sdk v1.0.0

* deprecate tenant ID

* update doc

* fix lint

* fix lint

* remove blank space

* fix lint

* fix lint

* fix lint

* remove tenant

* extend test timeout

* update adapp response

---------

Co-authored-by: Neil Ye <yechenwei2007@hotmail.com>
Co-authored-by: neil-yechenwei <v-cheye@microsoft.com>
ansible-collections#1316

# Conflicts:
#	plugins/modules/azure_rm_virtualmachine.py
@lm-sig
Copy link
Author

lm-sig commented Nov 13, 2023

I added a test case and updated to the latest 'dev' branch changes. As of today (2023-11-13) there should be no outstanding issues. Thanks.

@Fred-sun
Copy link
Collaborator

@lm-sig Thanks for your update! The 'os_disk_encryption_set_id' was added in #1306 and 'disk_encrytpion_set_id' was added in PR #1309. Thank you!

@lm-sig
Copy link
Author

lm-sig commented Nov 14, 2023

It's unfortunate Red Hat / @ephracis didn't see this was being worked on for several months, but thank you for the update. I guess this can be closed. Is there an ETA on the 1.19.0 release?

@lm-sig lm-sig closed this Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium_priority Medium priority work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ansible support enable VM Disk Encryption
4 participants