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

Refs #1033 fix security profile for azure_rm_virtualmachine_info #1205

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions plugins/modules/azure_rm_virtualmachine_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,39 +275,39 @@
description:
- Specifies the Security related profile settings for the virtual machine.
type: complex
returned: always
returned: when-used
contains:
encryption_at_host:
description:
- This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine.
- This will enable the encryption for all the disks including Resource/Temp disk at host itself.
type: bool
returned: always
returned: when-enabled
sample: True
security_type:
description:
- Specifies the SecurityType of the virtual machine.
- It is set as TrustedLaunch to enable UefiSettings.
type: str
returned: always
returned: when-enabled
sample: TrustedLaunch
uefi_settings:
description:
- Specifies the security settings like secure boot and vTPM used while creating the virtual machine.
type: complex
returned: always
returned: when-enabled
contains:
secure_boot_enabled:
description:
- Specifies whether secure boot should be enabled on the virtual machine.
type: bool
returned: always
returned: when-enabled
sample: True
v_tpm_enabled:
description:
- Specifies whether vTPM should be enabled on the virtual machine.
type: bool
returned: always
returned: when-enabled
sample: True
'''

Expand Down Expand Up @@ -459,11 +459,16 @@ def serialize_vm(self, vm):

if vm.security_profile is not None:
new_result['security_profile'] = dict()
new_result['security_profile']['encryption_at_host'] = vm.security_profile.encryption_at_host
new_result['security_profile']['security_type'] = vm.security_profile.security_type
new_result['security_profile']['uefi_settings'] = dict()
new_result['security_profile']['uefi_settings']['secure_boot_enabled'] = vm.security_profile.uefi_settings.secure_boot_enabled
new_result['security_profile']['uefi_settings']['v_tpm_enabled'] = vm.security_profile.uefi_settings.v_tpm_enabled
if vm.security_profile.encryption_at_host is not None:
new_result['security_profile']['encryption_at_host'] = vm.security_profile.encryption_at_host
if vm.security_profile.security_type is not None:
new_result['security_profile']['security_type'] = vm.security_profile.security_type
if vm.security_profile.uefi_settings is not None:
new_result['security_profile']['uefi_settings'] = dict()
if vm.security_profile.uefi_settings.secure_boot_enabled is not None:
new_result['security_profile']['uefi_settings']['secure_boot_enabled'] = vm.security_profile.uefi_settings.secure_boot_enabled
if vm.security_profile.uefi_settings.v_tpm_enabled is not None:
new_result['security_profile']['uefi_settings']['v_tpm_enabled'] = vm.security_profile.uefi_settings.v_tpm_enabled

new_result['power_state'] = power_state
new_result['display_status'] = display_status
Expand Down