Sudo, pattern etc

206 views
Skip to first unread message

Olivier GRUEL

unread,
Oct 13, 2017, 2:58:20 AM10/13/17
to rundeck-discuss
Hello all

A question about sudo  prompt pattern

I have several servers under rundeck, vers 2.7.1
With all serveur with the ubuntu OS, remote sudo commands are running fine.

With a raspberry and a python script, it's not OK

On this raspberry, when I running interactive command with sudo, I see that


rundeck@SERVER:/home/pi $ sudo /Projets/domotique/lcd3.py /Projets/domotique/affiche_nagios.lcd
argument :  /Projets/domotique/affiche_nagios.lcd
Le fichier à afficher est : /Projets/domotique/affiche_nagios.lcd
NAGIOS-SERVICES
Liste :  128

Liste :  192
OK : 156 C: 57
Liste :  148
W: 3 U: 3
Liste :  212


No passwd is required because in /etc/sudoers

rundeck ALL=(ALL:ALL) NOPASSWD: ALL

When i lauch this command within a rundeck job
. Affiche Nagios==>LCDargument : affiche_nagios.lcd
08:41:52

Le fichier à afficher est : affiche_nagios.lcd
08:41:52

NAGIOS-SERVICES
08:41:52

Liste : 128
08:41:52

08:41:52

Liste : 192
08:41:52

OK : 160 C: 55
08:41:52

Liste : 148
08:41:52

W: 1 U: 3
08:41:52

Liste : 212
08:41:53

Remote command failed with exit status -1
08:41:53

Sudo execution password response failed: Failed waiting for input prompt: Expected input was not seen in 5000 milliseconds
08:41:53

Failed: NonZeroResultCode: Remote command failed with exit status -1
08:41:53RUNDECK

Execution failed: 144597 in project DOMOTIQUE: [Workflow result: , step failures: {2=Dispatch failed on 1 nodes: [SERVER: NonZeroResultCode: Remote command failed with exit status -1]}, Node failures: {RASPAIL=[NonZeroResultCode: Remote command failed with exit status -1]}, status: failed]


in my project config file
project.sudo-command-pattern=^sudo$
project.sudo-prompt-pattern=^\[sudo\] Mot de passe de rundeck :
                                [sudo] password for rundeck:$


Result is failed but the job is done !!!

Any ideas ? Thanks in advance
Olivier

Alex Honor

unread,
Oct 31, 2017, 4:56:59 PM10/31/17
to rundeck-discuss
It appears that rundeck is waiting for a prompt but the remote node has NOPASSWD set so it should not prompt you. Can you remove the project.sudo* properties?
If other nodes need them, you can define those patterns on a per-node basis.

Thanks

Olivier GRUEL

unread,
Dec 21, 2017, 2:34:26 AM12/21/17
to rundeck-discuss
Thank you Alex

ssh-copy-id -i id_rsa.pub to all servers

and setup my project to ssh authentification., that's what I've done...and everything is OK now.

Olivier GRUEL

unread,
Dec 21, 2017, 2:34:58 AM12/21/17
to rundeck-discuss

Nacer BOUKERMA

unread,
Jun 27, 2018, 7:24:38 PM6/27/18
to rundeck-discuss
Salut Olivier, 

Peux-tu me dire les actions que tu as faites pour : "and setup my project to ssh authentification.," 

Je te remercie d'avance. 

Nacer. 
Reply all
Reply to author
Forward
0 new messages