From dd854baba2ae0e58f945ec17dee8c3cc0b3929c4 Mon Sep 17 00:00:00 2001 From: Jim Ladd Date: Mon, 28 Jan 2019 16:40:15 -0800 Subject: [PATCH] Add support for Azure inventory plugin --- awx/main/models/inventory.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index 4e68e1009d..ec19ebb6ab 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -1918,8 +1918,20 @@ class PluginFileInjector(object): class azure_rm(PluginFileInjector): + plugin_name = 'azure_rm' + initial_version = '2.7' ini_env_reference = 'AZURE_INI_PATH' + def inventory_as_dict(self, inventory_source): + ret = dict( + plugin='azure_rm', + ) + # TODO: all regions currently failing due to: + # https://github.com/ansible/ansible/pull/48079 + if inventory_source.source_regions and 'all' not in inventory_source.source_regions: + ret['regions'] = inventory_source.source_regions.split(',') + return ret + def build_script_private_data(self, inventory_update, private_data_dir): cp = configparser.RawConfigParser() section = 'azure'