Search code examples
gitsshrundeck

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?


Solution

  • The quoting of your arguments are interpreted as a space-separated sequence of strings, you can review the rules in the documentation.