Skip to content

Commit

Permalink
Add vm_agent_version to output of azure_rm_virtualmachine_info (#1289)
Browse files Browse the repository at this point in the history
* Add vm_agent_version to output

* Apply suggestions from code review

Co-authored-by: Fred-sun <[email protected]>

---------

Co-authored-by: Fred-sun <[email protected]>
  • Loading branch information
Klaas- and Fred-sun authored Nov 14, 2023
1 parent e4a8054 commit ee30130
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/modules/azure_rm_virtualmachine_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@
returned: always
type: dict
sample: { "key1":"value1" }
vm_agent_version:
description:
- Version of the Azure VM Agent (waagent) running inside the VM.
returned: always
type: str
sample: '2.9.1.1'
vm_size:
description:
- Virtual machine size.
Expand Down Expand Up @@ -459,6 +465,11 @@ def serialize_vm(self, vm):

new_result = {}

if instance.get('vm_agent') is not None:
new_result['vm_agent_version'] = instance['vm_agent'].get('vm_agent_version')
else:
new_result['vm_agent_version'] = 'Unknown'

if vm.security_profile is not None:
new_result['security_profile'] = dict()
if vm.security_profile.encryption_at_host is not None:
Expand Down

0 comments on commit ee30130

Please sign in to comment.