rundeck-ec2-nodes-plugin
rundeck-ec2-nodes-plugin copied to clipboard
Run command with sudo without disabling requiretty
Hi ,
I'm using the rundeck-ec2-nodes-plugin and i need to run command with sudo .
when I'm running them as sudo I'm getting the next error :
sudo: sorry, you must have a tty to run sudo
i don't want to comment : Defaults requiretty
from sudoers file .
Also i didn't fine if i can add "sudo authentication" for ec2 plugin .
Thanks for your help Amit
@gschueler
Can you help ?
enable sudo for the node see http://rundeck.org/docs/plugins-user-guide/ssh-plugins.html#secondary-sudo-password-authentication
for ec2 plugin you willl have to add the attributes to the mapping definition in the plugin
@gschueler
added :
ssh-keypath.default=/var/lib/rundeck/.ssh/id_rsa;username.default=rundeck;hostname.selector=privateIpAddress;sudo-command-enabled="true"
but still i'm getting tty issue:
sudo: sorry, you must have a tty to run sudo 09:38:02 Remote command failed with exit status 1 09:38:02 Failed: NonZeroResultCode: Remote command failed with exit status 1
you would need sudo-command-enabled.default=true
@gschueler I have this entry, but still getting errors - anything I am missing?
@dvg06 what does your generated node definition look like?
@gschueler apologies , newbie here. I am trying to use ec2 plugin since I wanted to run commands as splunk user in many instances. I do no have the password, but ec2-user has sudo su access.
field mapping: nodename.selector=instanceId;privateIpAddress.selector=privateIpAddress;hostname.selector=privateIpAddress,privateDnsName,publicDnsName;username.default=centos; sudo-command-enabled.default=true
@gschueler - anything I am missing ?
@amitdaniel86 When configuring the Node Executor, make sure to check the "Force PTY" checkbox, this will always force the use of a new pty.