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

updated code to fetch availability zone info into hostvars #243

Merged
merged 6 commits into from
Sep 15, 2020

Conversation

ShwetaliBerad
Copy link
Contributor

SUMMARY

updated code to fetch availability zone info into hostvars via Azure Inventory Script
#161

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Dynamic Inventory Script

@ShwetaliBerad ShwetaliBerad changed the title updated code to fetch availability zone info into hostvars [WIP]updated code to fetch availability zone info into hostvars Aug 31, 2020
@ShwetaliBerad ShwetaliBerad changed the title [WIP]updated code to fetch availability zone info into hostvars updated code to fetch availability zone info into hostvars Sep 8, 2020
@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun could you please assign reviewer for this PR ?

@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun Could you please look into this PR ?

@Fred-sun
Copy link
Collaborator

Yes, the review of this PR was delayed due to other issues recently, and I will focus on review tomorrow. Thank you!

@Fred-sun
Copy link
Collaborator

@ShwetaliBerad Thank you for your contribution. What is the purpose of this parameter? Can you give us a sample for this parameter?

@ShwetaliBerad
Copy link
Contributor Author

@ShwetaliBerad Thank you for your contribution. What is the purpose of this parameter? Can you give us a sample for this parameter?
Screenshot from 2020-09-11 13-58-02

@Fred-sun
This parameter will give the availability zone value in which the particular VM resides. On Azure, while creating VM , we can set Availability option as availability zone, and we can select availability zone value as 1 or 2 or 3. An availability zone is a physically separate zone in an Azure region. It is a high-availability offering that protects your applications and data from datacenter failures. If we choose availability zone for particular VM, then managed disk and public IP (if you have one) will be created in the same availability zone as your virtual machine.
API Response for VM in availability zone '1' is as follows :
{
"name": "test",
"id": "<vm_id>",
"type": "Microsoft.Compute/virtualMachines",
"location": "southeastasia",
............
"zones": [
"1"
]
}

@Fred-sun
Copy link
Collaborator

@ShwetaliBerad I will review it again. Thank you very much!

@Fred-sun
Copy link
Collaborator

Hi @ShwetaliBerad No problem, but it only supports the ansible version after 2.10. Ansible/plugin/inventory/azure_rm.py will be used before 2.10, thanks!

If you want ansible 2.9 to also support it, you need to add patch to 2.9 and modify ansible/plugin/inventory/azure_rm.py.

@Fred-sun
Copy link
Collaborator

I will advance the merger. Thank you!

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged medium_priority Medium priority labels Sep 14, 2020
@haiyuazhang
Copy link
Contributor

@ShwetaliBerad thanks for contributing to the azure collection! According to @Fred-sun 's testing result, this PR will only enable this feature in ansible 2.10+. If your target ansible version is 2.9, then the same change need to be made in ansible 2.9, what you need to do is submit a similar PR targeting ansible2.9-stable. I'll close and merge this one anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants