简体   繁体   中英

Rundeck: running command in remote server using ssh

I have a server with rundeck (and is my only node), and I have two servers with code.

I want to let rundeck ssh on those servers and run git pull over both of them, so, I'm trying to run this command:

ssh -i /var/lib/rundeck/.ssh/deployQA root@machine_ip "cd /var/www/html && git pull"

If I try to run this while I'm inside the rundeck machine, with the rundeck user, everything works. But when I try to run it from the rundeck webapp I get this error:

fatal: not a git repository (or any parent up to mount point /var/log) 11:31:15         Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

first: I don't want to add those machines as nodes, because their ip's could change, so, I want to make a job who get the ip's of the machine and the run git pull on each of them.

Any ideas on why this isn't working?

参数的引用被解释为以空格分隔的字符串序列,您可以查看文档中的规则。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM