mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
adding variables for cloudforms and satellite and fixing
various other bugs related to the credentials for a source
This commit is contained in:
@@ -101,12 +101,17 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.credentialBasePath = GetBasePath('credentials') + '?credential_type__kind__in=cloud,network';
|
// $scope.credentialBasePath = GetBasePath('credentials') + '?credential_type__kind__in=cloud,network';
|
||||||
|
|
||||||
$scope.sourceChange = function(source) {
|
$scope.sourceChange = function(source) {
|
||||||
source = (source && source.value) ? source.value : '';
|
source = (source && source.value) ? source.value : '';
|
||||||
$scope.credentialBasePath = GetBasePath('credentials') + '?credential_type__kind__in=cloud,network';
|
if ($scope.source.value === "scm" && $scope.source.value === "custom") {
|
||||||
if (source === 'ec2' || source === 'custom' || source === 'vmware' || source === 'openstack' || source === 'scm') {
|
$scope.credentialBasePath = GetBasePath('credentials') + '?credential_type__kind__in=cloud,network';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$scope.credentialBasePath = (source === 'ec2') ? GetBasePath('credentials') + '?kind=aws' : GetBasePath('credentials') + (source === '' ? '' : '?kind=' + (source));
|
||||||
|
}
|
||||||
|
if (source === 'ec2' || source === 'custom' || source === 'vmware' || source === 'openstack' || source === 'scm' || source === 'cloudforms' || source === "satellite6") {
|
||||||
$scope.envParseType = 'yaml';
|
$scope.envParseType = 'yaml';
|
||||||
|
|
||||||
var varName;
|
var varName;
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
|||||||
function initSourceSelect() {
|
function initSourceSelect() {
|
||||||
$scope.source = _.find($scope.source_type_options, { value: inventorySourceData.source });
|
$scope.source = _.find($scope.source_type_options, { value: inventorySourceData.source });
|
||||||
var source = $scope.source && $scope.source.value ? $scope.source.value : null;
|
var source = $scope.source && $scope.source.value ? $scope.source.value : null;
|
||||||
|
$scope.cloudCredentialRequired = source !== '' && source !== 'scm' && source !== 'custom' && source !== 'ec2' ? true : false;
|
||||||
CreateSelect2({
|
CreateSelect2({
|
||||||
element: '#inventory_source_source',
|
element: '#inventory_source_source',
|
||||||
multiple: false
|
multiple: false
|
||||||
@@ -149,7 +149,8 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
|||||||
|
|
||||||
if (source === 'ec2' || source === 'custom' ||
|
if (source === 'ec2' || source === 'custom' ||
|
||||||
source === 'vmware' || source === 'openstack' ||
|
source === 'vmware' || source === 'openstack' ||
|
||||||
source === 'scm') {
|
source === 'scm' || source === 'cloudforms' ||
|
||||||
|
source === 'satellite6') {
|
||||||
|
|
||||||
var varName;
|
var varName;
|
||||||
if (source === 'scm') {
|
if (source === 'scm') {
|
||||||
@@ -369,8 +370,13 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
|||||||
|
|
||||||
$scope.sourceChange = function(source) {
|
$scope.sourceChange = function(source) {
|
||||||
source = (source && source.value) ? source.value : '';
|
source = (source && source.value) ? source.value : '';
|
||||||
$scope.credentialBasePath = GetBasePath('credentials') + '?credential_type__kind__in=cloud,network';
|
if ($scope.source.value === "scm" && $scope.source.value === "custom") {
|
||||||
if (source === 'ec2' || source === 'custom' || source === 'vmware' || source === 'openstack' || source === 'scm') {
|
$scope.credentialBasePath = GetBasePath('credentials') + '?credential_type__kind__in=cloud,network';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$scope.credentialBasePath = (source === 'ec2') ? GetBasePath('credentials') + '?kind=aws' : GetBasePath('credentials') + (source === '' ? '' : '?kind=' + (source));
|
||||||
|
}
|
||||||
|
if (source === 'ec2' || source === 'custom' || source === 'vmware' || source === 'openstack' || source === 'scm' || source === 'cloudforms' || source === "satellite6") {
|
||||||
$scope.envParseType = 'yaml';
|
$scope.envParseType = 'yaml';
|
||||||
|
|
||||||
var varName;
|
var varName;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ return {
|
|||||||
type: 'lookup',
|
type: 'lookup',
|
||||||
list: 'CredentialList',
|
list: 'CredentialList',
|
||||||
basePath: 'credentials',
|
basePath: 'credentials',
|
||||||
ngShow: "source && source.value !== ''",
|
ngShow: "source && source.value !== '' && source.value !== 'custom'",
|
||||||
sourceModel: 'credential',
|
sourceModel: 'credential',
|
||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
ngClick: 'lookupCredential()',
|
ngClick: 'lookupCredential()',
|
||||||
@@ -274,6 +274,54 @@ return {
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
subForm: 'sourceSubForm'
|
subForm: 'sourceSubForm'
|
||||||
},
|
},
|
||||||
|
cloudforms_variables: {
|
||||||
|
id: 'cloudforms_variables',
|
||||||
|
label: i18n._('Source Variables'),
|
||||||
|
ngShow: "source && source.value == 'cloudforms'",
|
||||||
|
type: 'textarea',
|
||||||
|
class: 'Form-textAreaLabel Form-formGroup--fullWidth',
|
||||||
|
rows: 6,
|
||||||
|
'default': '---',
|
||||||
|
parseTypeName: 'envParseType',
|
||||||
|
dataTitle: "Source Variables",
|
||||||
|
dataPlacement: 'right',
|
||||||
|
awPopOver: "<p>Override variables found in openstack.yml and used by the inventory update script. For an example variable configuration " +
|
||||||
|
"<a href=\"https://github.com/ansible/ansible/blob/devel/contrib/inventory/cloudforms.ini\" target=\"_blank\">" +
|
||||||
|
"view openstack.yml in the Ansible github repo.</a></p>" +
|
||||||
|
"<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
|
||||||
|
"JSON:<br />\n" +
|
||||||
|
"<blockquote>{<br /> \"somevar\": \"somevalue\",<br /> \"password\": \"magic\"<br /> }</blockquote>\n" +
|
||||||
|
"YAML:<br />\n" +
|
||||||
|
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
|
||||||
|
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
|
||||||
|
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
|
||||||
|
dataContainer: 'body',
|
||||||
|
subForm: 'sourceSubForm'
|
||||||
|
},
|
||||||
|
satellite6_variables: {
|
||||||
|
id: 'satellite6_variables',
|
||||||
|
label: i18n._('Source Variables'),
|
||||||
|
ngShow: "source && source.value == 'satellite6'",
|
||||||
|
type: 'textarea',
|
||||||
|
class: 'Form-textAreaLabel Form-formGroup--fullWidth',
|
||||||
|
rows: 6,
|
||||||
|
'default': '---',
|
||||||
|
parseTypeName: 'envParseType',
|
||||||
|
dataTitle: "Source Variables",
|
||||||
|
dataPlacement: 'right',
|
||||||
|
awPopOver: "<p>Override variables found in openstack.yml and used by the inventory update script. For an example variable configuration " +
|
||||||
|
"<a href=\"https://github.com/ansible/ansible/blob/devel/contrib/inventory/foreman.ini\" target=\"_blank\">" +
|
||||||
|
"view openstack.yml in the Ansible github repo.</a></p>" +
|
||||||
|
"<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
|
||||||
|
"JSON:<br />\n" +
|
||||||
|
"<blockquote>{<br /> \"somevar\": \"somevalue\",<br /> \"password\": \"magic\"<br /> }</blockquote>\n" +
|
||||||
|
"YAML:<br />\n" +
|
||||||
|
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
|
||||||
|
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
|
||||||
|
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
|
||||||
|
dataContainer: 'body',
|
||||||
|
subForm: 'sourceSubForm'
|
||||||
|
},
|
||||||
verbosity: {
|
verbosity: {
|
||||||
label: i18n._('Verbosity'),
|
label: i18n._('Verbosity'),
|
||||||
type: 'select',
|
type: 'select',
|
||||||
|
|||||||
Reference in New Issue
Block a user