Implement Azure RM creds and inventory

* Vendor ansible's azure_rm inventory script
* Add new inventory type
* Add new credential type
* Expand host instance_id column from varchar 100 to 1024 to accept the
  long instance ids returned by Azure
* Make the inventory_import azure match rename more explicit.
This commit is contained in:
Matthew Jones
2016-04-21 13:51:30 -04:00
parent 5543448a43
commit 296f70ce17
12 changed files with 943 additions and 14 deletions

View File

@@ -355,7 +355,7 @@ class Host(CommonModelNameNotUnique, ResourceMixin):
help_text=_('Is this host online and available for running jobs?'),
)
instance_id = models.CharField(
max_length=100,
max_length=1024,
blank=True,
default='',
)
@@ -748,7 +748,8 @@ class InventorySourceOptions(BaseModel):
('rax', _('Rackspace Cloud Servers')),
('ec2', _('Amazon EC2')),
('gce', _('Google Compute Engine')),
('azure', _('Microsoft Azure')),
('azure', _('Microsoft Azure Classic (deprecated)')),
('azure_rm', _('Microsoft Azure Resource Manager')),
('vmware', _('VMware vCenter')),
('foreman', _('Satellite 6')),
('cloudforms', _('CloudForms')),
@@ -969,6 +970,10 @@ class InventorySourceOptions(BaseModel):
regions.insert(0, ('all', 'All'))
return regions
@classmethod
def get_azure_rm_region_choices(self):
return InventorySourceOptions.get_azure_region_choices()
@classmethod
def get_vmware_region_choices(self):
"""Return a complete list of regions in VMware, as a list of two-tuples