azure icon indicating copy to clipboard operation
azure copied to clipboard

Azure Resource Manager inventory plugin: Allow setting resources groups to include at runtime

Open christophetd opened this issue 4 years ago • 7 comments

SUMMARY

Allow setting resources groups to include at runtime via environment variable

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

Azure Resource Manager inventory plugin

ADDITIONAL INFORMATION

Currently, the Azure resource groups to include in the inventory needs to be provided as part of the provider's configuration file:

plugin: azure_rm
auth_source: cli
include_vm_resource_groups:
- my-rg1
- my-rg2

This is a quite strong limitation because it doesn't allow you to dynamically specify these groups at runtime. Also, the Python script provided for dynamic inventories in the previous Ansible versions did allow to set an environment variable to control this behaviour.

Sample usage:

ANSIBLE_AZURE_INCLUDE_VM_RESOURCE_GROUPS=my-rg1,my-rg2
ansible-playbook -i azure_rm.yml ...

christophetd avatar Jun 08 '20 18:06 christophetd

@christophetd Thanks for you submit the issue. we will investigate those feature! Thank you very much!

Fred-sun avatar Jul 29 '20 08:07 Fred-sun

Thanks, looking forward to it!

christophetd avatar Aug 01 '20 11:08 christophetd

@Fred-sun any updates on this? I'm hitting the same issue of needing to specify the resource groups at runtime in pipelines. It doesn't appear that variables of any form are evaluated for include_vm_resource_groups and I'm thinking I'm going to be forced into dynamically inserting into the inventory file.

Liquidmantis avatar Aug 18 '21 14:08 Liquidmantis

@Liquidmantis Yes, if we want to include VMS under a certain resource group, it is necessary to enable dynamsterting into the inventory file. Thank you very much!

Fred-sun avatar Aug 18 '21 15:08 Fred-sun

Thanks, looking forward to it!

@christophetd Yes, if you want to dynamically obtain VMS under a resource group, you need to obtain VMS from the Dynamic Inventory method. Thank you very much!

Fred-sun avatar Aug 18 '21 15:08 Fred-sun

Is there any update on this? This would be tremendously helpful for deploying to multiple environments which we segregate by resource groups.

joshlrogers avatar Dec 10 '21 18:12 joshlrogers

fixes by #975

Fred-sun avatar Sep 20 '22 01:09 Fred-sun

@Fred-sun any update on your MR? Thanks for your work!

HarishHary avatar Nov 14 '22 19:11 HarishHary

@HarishHary It has fixed by #975, and this PR is ready, It will be merged as soon as possible! Thank you very much!

Fred-sun avatar Nov 15 '22 05:11 Fred-sun

Hello @Fred-sun, thanks for the fix again! Do you know when a new release is planned for the plugin? Still can't use it in production.

HarishHary avatar Feb 09 '23 14:02 HarishHary

Hey! @HarishHary we are also waiting for this, our issue: Cannot pass variables into the dynamic inventory configuration.

@Fred-sun any plans for releasing?

PiotrWachulec avatar Feb 15 '23 10:02 PiotrWachulec

@PiotrWachulec @HarishHary Recently we want to upgrade a package, they will be released together, the upgrade is under way, thank you!

Fred-sun avatar Feb 15 '23 15:02 Fred-sun

Great, we are waiting! :)

PiotrWachulec avatar Feb 16 '23 09:02 PiotrWachulec