From 56a08e8cec826846407a7f61d2ee7cfd1d225d62 Mon Sep 17 00:00:00 2001 From: Jason Qualman <1653866+qualman@users.noreply.github.com> Date: Wed, 16 Mar 2022 15:44:40 -0700 Subject: [PATCH] Add private IP info to Azure Node --- README.md | 2 ++ .../groovy/com/rundeck/plugins/azure/azure/AzureNode.groovy | 4 ++++ .../com/rundeck/plugins/azure/azure/AzureNodeMapper.groovy | 1 + 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index d7cd0eb..37c1001 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ osDisk:name.selector = azure_osDisk_name osDisk:createOption.selector = azure_osDisk_createOption osDisk:diskSizeGB.selector = azure_osDisk_diskSizeGB +netInterface:privateIp.selector = azure_netInterface_privateIp + plan:name.selector = azure_plan_name plan:product.selector = azure_plan_product plan:publisher.selector = azure_plan_publisher diff --git a/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNode.groovy b/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNode.groovy index b4bc011..4b8d1f7 100644 --- a/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNode.groovy +++ b/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNode.groovy @@ -111,6 +111,8 @@ class AzureNode { azureAttributes."osDisk:createOption" = vm.storageProfile()?.osDisk()?.createOption()?.toString() azureAttributes."osDisk:diskSizeGB" = vm.storageProfile()?.osDisk()?.diskSizeGB()?.toString() + azureAttributes."netInterface:privateIp" = vm.getPrimaryNetworkInterface()?.primaryPrivateIP() + if(vm.instanceView().vmAgent()!=null) { vm.instanceView().vmAgent().statuses()?.each { status-> azureAttributes."provisioningState:code" = status.code() @@ -157,6 +159,8 @@ class AzureNode { case "azure_osDisk_createOption": return getAzureAttributes()!=null ? getAzureAttributes().get("osDisk:createOption"):null case "azure_osDisk_diskSizeGB": return getAzureAttributes()!=null ? getAzureAttributes().get("osDisk:diskSizeGB"):null + case "azure_netInterface_privateIp": return getAzureAttributes()!=null ? getAzureAttributes().get("netInterface:privateIp"):null + case "azure_provisioningState_code": return getAzureAttributes()!=null ? getAzureAttributes().get("provisioningState:code"):null case "azure_provisioningState_displayStatus": return getAzureAttributes()!=null ? getAzureAttributes().get("provisioningState:displayStatus"):null case "azure_provisioningState_message": return getAzureAttributes()!=null ? getAzureAttributes().get("provisioningState:message"):null diff --git a/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNodeMapper.groovy b/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNodeMapper.groovy index 04d75d5..210f9b7 100644 --- a/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNodeMapper.groovy +++ b/src/main/groovy/com/rundeck/plugins/azure/azure/AzureNodeMapper.groovy @@ -39,6 +39,7 @@ class AzureNodeMapper { "osDisk\\:name.selector=azure_osDisk_name\n" + "osDisk\\:createOption.selector=azure_osDisk_createOption\n" + "osDisk\\:diskSizeGB.selector=azure_osDisk_diskSizeGB\n" + + "netInterface\\:privateIp.selector=azure_netInterface_privateIp\n" + "provisioningState\\:code.selector=azure_provisioningState_code\n" + "provisioningState\\:displayStatus.selector=azure_provisioningState_displayStatus\n" + "provisioningState\\:message.selector=azure_provisioningState_message\n" +