Skip to content

Add availability zones to azure_rm_virtualmachine_info module - #523

Merged
haiyuazhang merged 3 commits into
ansible-collections:devfrom
ChandlerSwift:add-availability-zone-to-vm-info
May 13, 2021
Merged

Add availability zones to azure_rm_virtualmachine_info module#523
haiyuazhang merged 3 commits into
ansible-collections:devfrom
ChandlerSwift:add-availability-zone-to-vm-info

Conversation

@ChandlerSwift

@ChandlerSwift ChandlerSwift commented May 4, 2021

Copy link
Copy Markdown
Contributor
SUMMARY

Adds availability zone info to the azure_rm_virtualmachine_info module
fixes #522

This is, in a way, an extension of #243.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_rm_virtualmachine_info

ADDITIONAL INFORMATION

With this PR, output looks like:

TASK [test : debug] **************************************************************************************************************
task path: /ansible/roles/test/tasks/main.yml:27
 ok: [...] => {
     "vm_info": {
         "changed": false,
         "failed": false,
         "vms": [
             {
                 "admin_username": "...",
                 "boot_diagnostics": {
                     "console_screenshot_uri": "...",
                     "enabled": true,
                     "serial_console_log_uri": "...",
                     "storage_uri": "..."
                 },
                 "data_disks": [
                     {
                         "caching": "ReadWrite",
                         "disk_size_gb": 128,
                         "lun": 0,
                         "managed_disk_type": "Premium_LRS"
                     }
                 ],
                 "id": "...",
                 "image": {
                     "id": "..."
                 },
                 "location": "...",
                 "name": "...",
                 "network_interface_names": [
                     "..."
                 ],
                 "os_disk_caching": "ReadWrite",
                 "os_type": "Linux",
                 "power_state": "running",
                 "resource_group": "...",
                 "state": "present",
                 "tags": {
                   ...
                 },
-                "vm_size": "..."
+                "vm_size": "...",
+                "zones": [
+                    "2"
+                ]
             }
         ]
     }
 }

@Xiuxi-Sun

Copy link
Copy Markdown

@ChandlerSwift Thanks for your contribution! I will review and push for merged!

@Fred-sun

Copy link
Copy Markdown
Collaborator

@ChandlerSwift Thanks for your contribution! Would you help to add test case for the new change? Thank you very much!

@Fred-sun Fred-sun added medium-priority Medium priority working In trying to solve, or in working with contributors labels May 12, 2021
Comment thread plugins/modules/azure_rm_virtualmachine_info.py Outdated
@haiyuazhang
haiyuazhang force-pushed the dev branch 2 times, most recently from 2281f46 to 8dfc8ed Compare May 12, 2021 11:26
@ChandlerSwift
ChandlerSwift force-pushed the add-availability-zone-to-vm-info branch from 63185e1 to 1e2d23c Compare May 12, 2021 21:04
Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
returned: always
type: str
sample: Standard_D4
zones:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add sample for this return value!

@haiyuazhang
haiyuazhang merged commit 7e3007b into ansible-collections:dev May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

medium-priority Medium priority working In trying to solve, or in working with contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add zone to azure_rm_virtualmachine_info module

4 participants