From 4ae3f00b70afa8725e4c7b32668604f8f8a078ea Mon Sep 17 00:00:00 2001 From: Klaas Demter Date: Mon, 16 Oct 2023 16:06:55 +0200 Subject: [PATCH 1/2] Add vm_agent_version to output --- plugins/modules/azure_rm_virtualmachine_info.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/modules/azure_rm_virtualmachine_info.py b/plugins/modules/azure_rm_virtualmachine_info.py index ef663b12c..bded0ccd7 100644 --- a/plugins/modules/azure_rm_virtualmachine_info.py +++ b/plugins/modules/azure_rm_virtualmachine_info.py @@ -242,6 +242,14 @@ 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: + - 'Unknown' + - '2.9.1.1' vm_size: description: - Virtual machine size. @@ -457,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: From 6b4a00cc72f4f2673d5eec68f36dc491d32fd666 Mon Sep 17 00:00:00 2001 From: Klaas Demter Date: Wed, 1 Nov 2023 07:41:57 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com> --- plugins/modules/azure_rm_virtualmachine_info.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/modules/azure_rm_virtualmachine_info.py b/plugins/modules/azure_rm_virtualmachine_info.py index bded0ccd7..8d5f3eea8 100644 --- a/plugins/modules/azure_rm_virtualmachine_info.py +++ b/plugins/modules/azure_rm_virtualmachine_info.py @@ -247,9 +247,7 @@ - Version of the Azure VM Agent (waagent) running inside the VM. returned: always type: str - sample: - - 'Unknown' - - '2.9.1.1' + sample: '2.9.1.1' vm_size: description: - Virtual machine size.