diff --git a/awx/ui/client/features/templates/templates.strings.js b/awx/ui/client/features/templates/templates.strings.js index f275e522a0..896cfd87bd 100644 --- a/awx/ui/client/features/templates/templates.strings.js +++ b/awx/ui/client/features/templates/templates.strings.js @@ -28,6 +28,7 @@ function TemplatesStrings (BaseString) { SURVEY: t.s('Survey'), PREVIEW: t.s('Preview'), LAUNCH: t.s('LAUNCH'), + CONFIRM: t.s('CONFIRM'), SELECTED: t.s('SELECTED'), NO_CREDENTIALS_SELECTED: t.s('No credentials selected'), NO_INVENTORY_SELECTED: t.s('No inventory selected'), @@ -51,6 +52,7 @@ function TemplatesStrings (BaseString) { CHOOSE_JOB_TYPE: t.s('Choose a job type'), CHOOSE_VERBOSITY: t.s('Choose a verbosity'), EXTRA_VARIABLES: t.s('Extra Variables'), + EXTRA_VARIABLES_HELP: t.s('

Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter for ansible-playbook. Provide key/value pairs using either YAML or JSON.

JSON:
{
"somevar": "somevalue",
"password": "magic"
}
YAML:
---
somevar: somevalue
password: magic
'), PLEASE_ENTER_ANSWER: t.s('Please enter an answer.'), PLEASE_SELECT_VALUE: t.s('Please select a value'), VALID_INTEGER: t.s('Please enter an answer that is a valid integer.'), diff --git a/awx/ui/client/src/scheduler/schedulerAdd.controller.js b/awx/ui/client/src/scheduler/schedulerAdd.controller.js index cd55b73ea0..c00df03e27 100644 --- a/awx/ui/client/src/scheduler/schedulerAdd.controller.js +++ b/awx/ui/client/src/scheduler/schedulerAdd.controller.js @@ -8,12 +8,12 @@ export default ['$filter', '$state', '$stateParams', '$http', 'Wait', '$scope', '$rootScope', 'CreateSelect2', 'ParseTypeChange', 'GetBasePath', 'Rest', 'ParentObject', 'JobTemplateModel', '$q', 'Empty', 'SchedulePost', 'ProcessErrors', 'SchedulerInit', '$location', 'PromptService', 'RRuleToAPI', 'moment', - 'WorkflowJobTemplateModel', + 'WorkflowJobTemplateModel', 'TemplatesStrings', function($filter, $state, $stateParams, $http, Wait, $scope, $rootScope, CreateSelect2, ParseTypeChange, GetBasePath, Rest, ParentObject, JobTemplate, $q, Empty, SchedulePost, ProcessErrors, SchedulerInit, $location, PromptService, RRuleToAPI, moment, - WorkflowJobTemplate + WorkflowJobTemplate, TemplatesStrings ) { var base = $scope.base || $location.path().replace(/^\//, '').split('/')[0], @@ -33,6 +33,7 @@ export default ['$filter', '$state', '$stateParams', '$http', 'Wait', }; $scope.preventCredsWithPasswords = true; + $scope.strings = TemplatesStrings; /* * This is a workaround for the angular-scheduler library inserting `ll` into fields after an diff --git a/awx/ui/client/src/scheduler/schedulerEdit.controller.js b/awx/ui/client/src/scheduler/schedulerEdit.controller.js index 6376664145..ec0a24842a 100644 --- a/awx/ui/client/src/scheduler/schedulerEdit.controller.js +++ b/awx/ui/client/src/scheduler/schedulerEdit.controller.js @@ -1,11 +1,11 @@ export default ['$filter', '$state', '$stateParams', 'Wait', '$scope', 'moment', '$rootScope', '$http', 'CreateSelect2', 'ParseTypeChange', 'ParentObject', 'ProcessErrors', 'Rest', 'GetBasePath', 'SchedulerInit', 'SchedulePost', 'JobTemplateModel', '$q', 'Empty', 'PromptService', 'RRuleToAPI', -'WorkflowJobTemplateModel', +'WorkflowJobTemplateModel', 'TemplatesStrings', function($filter, $state, $stateParams, Wait, $scope, moment, $rootScope, $http, CreateSelect2, ParseTypeChange, ParentObject, ProcessErrors, Rest, GetBasePath, SchedulerInit, SchedulePost, JobTemplate, $q, Empty, PromptService, RRuleToAPI, - WorkflowJobTemplate + WorkflowJobTemplate, TemplatesStrings ) { let schedule, scheduler, scheduleCredentials = []; @@ -21,6 +21,8 @@ function($filter, $state, $stateParams, Wait, $scope, moment, $scope.hideForm = true; $scope.parseType = 'yaml'; + $scope.strings = TemplatesStrings; + $scope.processSchedulerEndDt = function(){ // set the schedulerEndDt to be equal to schedulerStartDt + 1 day @ midnight var dt = new Date($scope.schedulerUTCTime); diff --git a/awx/ui/client/src/scheduler/schedulerForm.partial.html b/awx/ui/client/src/scheduler/schedulerForm.partial.html index bb68bfbaaf..9313db7f71 100644 --- a/awx/ui/client/src/scheduler/schedulerForm.partial.html +++ b/awx/ui/client/src/scheduler/schedulerForm.partial.html @@ -686,5 +686,5 @@ ng-disabled="!schedulerIsValid || promptModalMissingReqFields"> Save - + diff --git a/awx/ui/client/src/templates/prompt/prompt.controller.js b/awx/ui/client/src/templates/prompt/prompt.controller.js index 1a20ca1d2c..59cc2092db 100644 --- a/awx/ui/client/src/templates/prompt/prompt.controller.js +++ b/awx/ui/client/src/templates/prompt/prompt.controller.js @@ -73,16 +73,40 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel', if(vm.promptDataClone.launchConf.passwords_needed_to_start) { vm.promptDataClone.launchConf.passwords_needed_to_start.forEach((passwordNeeded) => { - if(passwordNeeded === "ssh_password") { - vm.promptDataClone.prompts.credentials.passwords.ssh = {}; - } - if(passwordNeeded === "become_password") { - vm.promptDataClone.prompts.credentials.passwords.become = {}; - } - if(passwordNeeded === "ssh_key_unlock") { - vm.promptDataClone.prompts.credentials.passwords.ssh_key_unlock = {}; - } - if(passwordNeeded.startsWith("vault_password")) { + if (passwordNeeded === "ssh_password") { + vm.promptDataClone.prompts.credentials.value.forEach((defaultCredential) => { + defaultCredential.passwords_needed.forEach((neededPassword) => { + if (neededPassword === "ssh_password") { + vm.promptDataClone.prompts.credentials.passwords.ssh = { + id: defaultCredential.id, + name: defaultCredential.name + }; + } + }); + }); + } else if (passwordNeeded === "become_password") { + vm.promptDataClone.prompts.credentials.value.forEach((defaultCredential) => { + defaultCredential.passwords_needed.forEach((neededPassword) => { + if (neededPassword === "become_password") { + vm.promptDataClone.prompts.credentials.passwords.become = { + id: defaultCredential.id, + name: defaultCredential.name + }; + } + }); + }); + } else if (passwordNeeded === "ssh_key_unlock") { + vm.promptDataClone.prompts.credentials.value.forEach((defaultCredential) => { + defaultCredential.passwords_needed.forEach((neededPassword) => { + if (neededPassword === "ssh_key_unlock") { + vm.promptDataClone.prompts.credentials.passwords.ssh_key_unlock = { + id: defaultCredential.id, + name: defaultCredential.name + }; + } + }); + }); + } else if (passwordNeeded.startsWith("vault_password")) { let vault_id = null; if (passwordNeeded.includes('.')) { vault_id = passwordNeeded.split(/\.(.+)/)[1]; diff --git a/awx/ui/client/src/templates/prompt/prompt.directive.js b/awx/ui/client/src/templates/prompt/prompt.directive.js index b09a3bcc84..e151760bb7 100644 --- a/awx/ui/client/src/templates/prompt/prompt.directive.js +++ b/awx/ui/client/src/templates/prompt/prompt.directive.js @@ -5,7 +5,7 @@ export default [ 'templateUrl', scope: { promptData: '=', onFinish: '&', - actionText: '@actionText', + actionText: '@', preventCredsWithPasswords: '<' }, templateUrl: templateUrl('templates/prompt/prompt'), diff --git a/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.partial.html b/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.partial.html index dcbf7f5a92..9d731d185f 100644 --- a/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.partial.html +++ b/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.partial.html @@ -93,7 +93,7 @@