mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 12:27:37 -02:30
adding options for privilege escalation drop down
this will get replaced by info from the back end.
This commit is contained in:
@@ -158,6 +158,21 @@ export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $r
|
|||||||
variable: 'credential_kind_options'
|
variable: 'credential_kind_options'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// GetChoices({
|
||||||
|
// scope: $scope,
|
||||||
|
// url: defaultUrl,
|
||||||
|
// field: 'become',
|
||||||
|
// variable: 'become_options'
|
||||||
|
// });
|
||||||
|
|
||||||
|
$scope.become_options = [
|
||||||
|
{ value: 'sudo', label: 'Sudo' },
|
||||||
|
{ value: 'su', label: 'Su' },
|
||||||
|
{ value: 'pbrun', label: 'Pbrun'},
|
||||||
|
{ value: 'pfexec', label: 'Pfexec'},
|
||||||
|
{ value: 'runas', label: 'Runas'}
|
||||||
|
];
|
||||||
|
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
form: form,
|
form: form,
|
||||||
@@ -314,7 +329,13 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $
|
|||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
$scope.id = id;
|
$scope.id = id;
|
||||||
|
$scope.become_options = [
|
||||||
|
{ value: 'sudo', label: 'Sudo' },
|
||||||
|
{ value: 'su', label: 'Su' },
|
||||||
|
{ value: 'pbrun', label: 'Pbrun'},
|
||||||
|
{ value: 'pfexec', label: 'Pfexec'},
|
||||||
|
{ value: 'runas', label: 'Runas'}
|
||||||
|
];
|
||||||
function setAskCheckboxes() {
|
function setAskCheckboxes() {
|
||||||
var fld, i;
|
var fld, i;
|
||||||
for (fld in form.fields) {
|
for (fld in form.fields) {
|
||||||
|
|||||||
@@ -274,27 +274,13 @@ export default
|
|||||||
hasShowInputButton: true,
|
hasShowInputButton: true,
|
||||||
askShow: "kind.value == 'ssh'", // Only allow ask for machine credentials
|
askShow: "kind.value == 'ssh'", // Only allow ask for machine credentials
|
||||||
},
|
},
|
||||||
"login_method": {
|
"become_method": {
|
||||||
label: "Privilege Escalation Credential",
|
label: "Privilege Escalation",
|
||||||
hintText: "If your playbooks use privilege escalation (\"sudo: true\", \"su: true\", etc), you can specify the username to become, and the password to use here.",
|
hintText: "If your playbooks use privilege escalation (\"sudo: true\", \"su: true\", etc), you can specify the username to become, and the password to use here.",
|
||||||
type: 'select',
|
type: 'select',
|
||||||
ngShow: "kind.value == 'ssh'",
|
ngShow: "kind.value == 'ssh'",
|
||||||
ngChange: "loginMethodChange()",
|
ngChange: "loginMethodChange()",
|
||||||
ngOptions: 'kind.label for kind in credential_kind_options track by kind.value',
|
ngOptions: 'become.label for become in become_options track by become.value',
|
||||||
// options: [{
|
|
||||||
// label: 'None', // FIXME: Maybe 'Default' or 'SSH only' instead?
|
|
||||||
// value: '',
|
|
||||||
// selected: true
|
|
||||||
// }, {
|
|
||||||
// label: 'Sudo',
|
|
||||||
// value: 'sudo'
|
|
||||||
// }, {
|
|
||||||
// label: 'Su',
|
|
||||||
// value: 'su'
|
|
||||||
// },{
|
|
||||||
// label: 'Pbrun',
|
|
||||||
// value: 'pbrun'
|
|
||||||
// }],
|
|
||||||
awPopOver: "<p><b>Sudo:</b> Optionally specify a username for sudo operations. "+
|
awPopOver: "<p><b>Sudo:</b> Optionally specify a username for sudo operations. "+
|
||||||
"This is equivalent to specifying the <code>ansible-playbook --sudo-user</code> parameter.<br />" +
|
"This is equivalent to specifying the <code>ansible-playbook --sudo-user</code> parameter.<br />" +
|
||||||
"<b>Su:</b> Optionally specify a username for su operations. This is equivalent to specifying the <code>ansible-playbook --su-user</code> parameter.<br/>"+
|
"<b>Su:</b> Optionally specify a username for su operations. This is equivalent to specifying the <code>ansible-playbook --su-user</code> parameter.<br/>"+
|
||||||
@@ -303,54 +289,18 @@ export default
|
|||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: "body"
|
dataContainer: "body"
|
||||||
},
|
},
|
||||||
"sudo_username": {
|
"become_username": {
|
||||||
label: 'Sudo Username',
|
label: 'Privilege Escalation Username',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "kind.value == 'ssh' && login_method == 'sudo'",
|
ngShow: "kind.value == 'ssh' && become_method",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
},
|
},
|
||||||
"sudo_password": {
|
"become_password": {
|
||||||
label: 'Sudo Password',
|
label: 'Privilege Escalation Password',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'ssh' && login_method == 'sudo'",
|
ngShow: "kind.value == 'ssh' && become_method",
|
||||||
addRequired: false,
|
|
||||||
editRequired: false,
|
|
||||||
ask: true,
|
|
||||||
hasShowInputButton: true,
|
|
||||||
autocomplete: false
|
|
||||||
},
|
|
||||||
"su_username": {
|
|
||||||
label: 'Su Username',
|
|
||||||
type: 'text',
|
|
||||||
ngShow: "kind.value == 'ssh' && login_method == 'su'",
|
|
||||||
addRequired: false,
|
|
||||||
editRequired: false,
|
|
||||||
autocomplete: false
|
|
||||||
},
|
|
||||||
"su_password": {
|
|
||||||
label: 'Su Password',
|
|
||||||
type: 'sensitive',
|
|
||||||
ngShow: "kind.value == 'ssh' && login_method == 'su'",
|
|
||||||
addRequired: false,
|
|
||||||
editRequired: false,
|
|
||||||
ask: true,
|
|
||||||
hasShowInputButton: true,
|
|
||||||
autocomplete: false
|
|
||||||
},
|
|
||||||
"pbrun_username": {
|
|
||||||
label: 'Pbrun Username',
|
|
||||||
type: 'text',
|
|
||||||
ngShow: "kind.value == 'ssh' && login_method == 'pbrun'",
|
|
||||||
addRequired: false,
|
|
||||||
editRequired: false,
|
|
||||||
autocomplete: false
|
|
||||||
},
|
|
||||||
"pbrun_password": {
|
|
||||||
label: 'Pbrun Password',
|
|
||||||
type: 'sensitive',
|
|
||||||
ngShow: "kind.value == 'ssh' && login_method == 'pbrun'",
|
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ask: true,
|
ask: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user