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

Add availability zones to azure_rm_virtualmachine_info module #523

Conversation

ChandlerSwift
Copy link
Contributor

@ChandlerSwift ChandlerSwift commented May 4, 2021

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

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

@Fred-sun
Copy link
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 work in In trying to solve, or in working with contributors labels May 12, 2021
@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>
@@ -234,6 +234,10 @@
returned: always
type: str
sample: Standard_D4
zones:
Copy link
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 work in 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