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

Support upper/lower case resource groups in azure_rm.py #43929

Merged
merged 1 commit into from Aug 13, 2018

Conversation

mike-pt
Copy link
Contributor

@mike-pt mike-pt commented Aug 10, 2018

Support upper/lower case resource groups

SUMMARY

Fixes #43917 which was originally reported by me in MicrosoftDocs/azure-docs#7111 but turned out to be a issue in the parsing the resource group name.

The fix is very simple so I decide to submit the PR

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

azure_rm.py script

ANSIBLE VERSION

n\a

ADDITIONAL INFORMATION

n\a

Support upper/lower case resource groups
@ansibot
Copy link
Contributor

ansibot commented Aug 10, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 azure bug This issue/PR relates to a bug. c:inventory/contrib_script cloud inventory Inventory category needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:community This issue/PR relates to code supported by the Ansible community. labels Aug 10, 2018
@TomArcherMsft
Copy link

Adding steps-to-reproduce:

Steps to reproduce:

  1. Browse to Azure portal.
  2. Open Cloud Shell
  3. az group create --resource-group AnsibleInventoryTestRG --location eastus
  4. az vm create --resource-group AnsibleInventoryTestRG --name ansible-inventory-test-vm1 --image UbuntuLTS --generate-ssh-keys
  5. az vm create --resource-group AnsibleInventoryTestRG --name ansible-inventory-test-vm2 --image UbuntuLTS --generate-ssh-keys
  6. az resource tag --tags nginx --id /subscriptions/ /resourceGroups/AnsibleInventoryTestRG/providers/Microsoft.Compute/virtualMachines/ansible-inventory-test-vm1
  7. wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/azure_rm.py
  8. chmod +x azure_rm.py
  9. ansible -i azure_rm.py ansible-inventory-test-rg -m ping

Expected behavior:
The last step should generate the dynamic inventory.

Result:
The call fails with an error stating: [WARNING]: Could not match supplied host pattern, ignoring: AnsibleInventoryTestRG

Notes:
If you specify a resource group name with all lower case letters is used, the call will succeed

@yuwzho
Copy link
Contributor

yuwzho commented Aug 13, 2018

shipit

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Aug 13, 2018
@yungezz yungezz merged commit fa8154d into ansible:devel Aug 13, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 azure bug This issue/PR relates to a bug. c:inventory/contrib_script cloud inventory Inventory category new_contributor This PR is the first contribution by a new community member. small_patch support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure inventory cannot list vms in resource group name contains upper case
5 participants