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 #1217

Closed

Conversation

lm-sig
Copy link

@lm-sig lm-sig commented Jul 17, 2023

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.

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.

line 1634, 1810 and 2066 line too long, longer than 160 characters.

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 labels Jul 19, 2023
lm-sig and others added 7 commits July 19, 2023 09:45
Co-authored-by: Marges, RSY (Rick) <rick.marges@achmea.nl>
* Improve Docs In `azure_rm_virtualnetwork`

* The DNS Servers should be a list of strings
* Remove the trailing comma in the `dict()` call for `dns_servers`
* The boolean values should default to a boolean value in the docs
* Clean up excess quotation in some of the examples

* Set the Argument Spec up to Validate List Element Typing

* Incorporate PR feedback from @Fred-sun correctly indicated that I didn't apply the elements parameter to the argument spec for `address_prefixes_cidr` and `dns_servers`
* This helps Ansible validate the list elements are the correct type for the 2 affected module parameters

* Remove Unneeded Ignores In Sanity

* As @Fred-sun pointed out a number of the sanity tests no longer need to ignore a failure condition with this PR
* Add new parameters to azure_rm_storageshare.py

* Add test case

* Fix sanity fail

* small change

* small change 02

* remove test case

* small change
Changed update_security_profle for update_security_profile
…sible-collections#1225)

* use module sub_id if definied

* use module sub_id if definied

* lint
@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels Aug 3, 2023
Fred-sun and others added 17 commits August 11, 2023 14:56
* Migrate ADAL to MSAL

* Fix the error when the password is empty

* sanity change

* Fix sanity fail

* small change

* Delete unused parameters

* delete x509_private_key_path
Bumps [cryptography](https://github.com/pyca/cryptography) from 38.0.3 to 39.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@38.0.3...39.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [cryptography](https://github.com/pyca/cryptography) from 39.0.1 to 41.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@39.0.1...41.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* add azure_rm_batchaccount_info.py

* Improve azure_rm_batchaccount test case

* change version to 16.0.0

* change version to 15.0.0

* new change

* last change

* small change

* last change
…az cli auth (ansible-collections#1175)

* Update azure_keyvault_secret.py

Added Azure CLI support
Updated documentation

* Update azure_keyvault_secret.py

Removed subscription_id from examples

* Applied suggestions

* import order changed
* Bump version to v1.17.0

* update change log

* update change log

* Add new commits

---------

Co-authored-by: xuzhang3 <Zhangxu894765>
* Migrate msrest to azure-core

* Fix missing change

* fix sanity fail

* Fixed import failure

* restore ignore file

* Fix missing change

* Update msrestazure'method to azure-mgmt-core'method

* Updates how http request return values are handled

* new change

* Changes the handling of return values

* Update azure_rm_appgateway test case

* Update azure_rm_appgateway test case

* Update azure_rm_iotdevice* to support trunck2

* update test case

* Add new change

* new change

* fix systax error:

* Modify azure_rm_virtualmachine.py

* Modify azure_rm_virtualmachinescalset.py

* Modify azure_rm_virtuamachinescalset.py

* last changed

* fix test fail

* last change

* Add query parameters to azure_rm_iotdevice_info
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.3 to 41.0.4.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@41.0.3...41.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#1272)

* Change ansible default version from 2.14 to 2.15

* fix sanity fail

* fix santiy error --- 02
@lm-sig
Copy link
Author

lm-sig commented Oct 16, 2023

I updated the commits against the latest 'dev' branch changes. Tested against Azure US Gov cloud. Still creating VMs with encrypted disks.

@xuzhang3
Copy link
Collaborator

xuzhang3 commented Nov 1, 2023

@lm-sig can you help resolve the conflict.

@lm-sig
Copy link
Author

lm-sig commented Nov 1, 2023

I am going to open a new pull request since the dev branch keeps changing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ansible support enable VM Disk Encryption
10 participants