diff --git a/awx/ui/static/js/controllers/Credentials.js b/awx/ui/static/js/controllers/Credentials.js index a5d11142cf..034acbb0a2 100644 --- a/awx/ui/static/js/controllers/Credentials.js +++ b/awx/ui/static/js/controllers/Credentials.js @@ -396,6 +396,10 @@ function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routePa case 'gce': $scope.email_address = data.username; $scope.project = data.project; + break; + case 'azure': + $scope.subscription_id = data.username; + } $scope.$emit('credentialLoaded'); diff --git a/awx/ui/static/js/forms/Credentials.js b/awx/ui/static/js/forms/Credentials.js index 49b45b3e13..e275e832ce 100644 --- a/awx/ui/static/js/forms/Credentials.js +++ b/awx/ui/static/js/forms/Credentials.js @@ -138,7 +138,7 @@ angular.module('CredentialFormDefinition', []) labelBind: 'usernameLabel', type: 'text', ngShow: "kind.value && kind.value !== 'aws' && " + - "kind.value !== 'gce'", + "kind.value !== 'gce' && kind.value!=='azure'", awRequiredWhen: { variable: 'aws_required', init: false @@ -155,6 +155,18 @@ angular.module('CredentialFormDefinition', []) }, autocomplete: false }, + "subscription_id": { + labelBind: "usernameLabel", + type: 'text', + ngShow: "kind.value == 'azure'", + awRequiredWhen: { + variable: 'subscription_required', + init: false + }, + addRequired: false, + editRequired: false, + autocomplete: false + }, "api_key": { label: 'API Key', type: 'password', @@ -289,6 +301,7 @@ angular.module('CredentialFormDefinition', []) editRequired: false, autocomplete: false }, + "vault_password": { label: "Vault Password", type: 'password', diff --git a/awx/ui/static/js/forms/Source.js b/awx/ui/static/js/forms/Source.js index add3e48feb..960748455c 100644 --- a/awx/ui/static/js/forms/Source.js +++ b/awx/ui/static/js/forms/Source.js @@ -15,7 +15,7 @@ angular.module('SourceFormDefinition', []) cancelButton: false, name: 'source', well: false, - + fields: { source: { label: 'Source', @@ -47,7 +47,7 @@ angular.module('SourceFormDefinition', []) source_regions: { label: 'Regions', type: 'text', - ngShow: "source && (source.value == 'rax' || source.value == 'ec2' || source.value == 'gce')", + ngShow: "source && (source.value == 'rax' || source.value == 'ec2' || source.value == 'gce' || source.value == 'azure')", addRequired: false, editRequired: false, awMultiselect: 'source_region_choices', @@ -150,7 +150,7 @@ angular.module('SourceFormDefinition', []) }, buttons: { - + }, related: { } diff --git a/awx/ui/static/js/helpers/Credentials.js b/awx/ui/static/js/helpers/Credentials.js index 59d2638753..d0677eb82d 100644 --- a/awx/ui/static/js/helpers/Credentials.js +++ b/awx/ui/static/js/helpers/Credentials.js @@ -27,6 +27,7 @@ angular.module('CredentialsHelper', ['Utilities']) scope.username_required = false; // JT-- added username_required b/c mutliple 'kinds' need username to be required (GCE) scope.key_required = false; // JT -- doing the same for key and project scope.project_required = false; + scope.subscription_required = false; if (!Empty(scope.kind)) { // Apply kind specific settings @@ -51,6 +52,12 @@ angular.module('CredentialsHelper', ['Utilities']) scope.key_required = true; scope.project_required = true; break; + case 'azure': + scope.usernameLabel = "Subscription ID"; + scope.sshKeyDataLabel = 'RSA Private Key'; + scope.subscription_required = true; + scope.key_required = true; + break; } } @@ -152,6 +159,9 @@ angular.module('CredentialsHelper', ['Utilities']) case 'gce': data.username = scope.email_address; data.project = scope.project; + break; + case 'azure': + data.username = scope.subscription_id; } if (Empty(data.team) && Empty(data.user)) { diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 36e6134243..2946fbe11a 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -243,9 +243,17 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' text: 'All' }]); $('#source_form').addClass('squeeze'); + } else if (scope.source.value === 'azure') { + scope.source_region_choices = scope.azure_regions; + //$('#s2id_group_source_regions').select2('data', []); + $('#s2id_source_source_regions').select2('data', [{ + id: 'all', + text: 'All' + }]); + $('#source_form').addClass('squeeze'); } - if (scope.source.value === 'rax' || scope.source.value === 'ec2'|| scope.source.value==='gce') { - kind = (scope.source.value === 'rax') ? 'rax' : (scope.source.value==='gce') ? 'gce' : 'aws'; + if (scope.source.value === 'rax' || scope.source.value === 'ec2'|| scope.source.value==='gce' || scope.source.value === 'azure') { + kind = (scope.source.value === 'rax') ? 'rax' : (scope.source.value==='gce') ? 'gce' : (scope.source.value==='azure') ? 'azure' : 'aws'; url = GetBasePath('credentials') + '?cloud=true&kind=' + kind; LookUpInit({ url: url, @@ -1044,6 +1052,15 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched callback: 'choicesReadyGroup' }); + GetChoices({ + scope: sources_scope, + url: GetBasePath('inventory_sources'), + field: 'source_regions', + variable: 'azure_regions', + choice_name: 'azure_region_choices', + callback: 'choicesReadyGroup' + }); + Wait('start'); if (parent_scope.removeAddTreeRefreshed) { diff --git a/config/awx-munin.conf b/config/awx-munin.conf new file mode 100644 index 0000000000..90c479f77a --- /dev/null +++ b/config/awx-munin.conf @@ -0,0 +1,17 @@ + +Alias /munin /var/cache/munin/www + + Order Allow,Deny + Allow from all + Options FollowSymLinks + + AuthUserFile /var/lib/awx/.munin_htpasswd + AuthName "Munin" + AuthType Basic + require valid-user + + + ExpiresActive On + ExpiresDefault M310 + +