Cannot execute a command on remote machine

It looks like your command depends on some environment vars.
Can you try the shell module instead of command?
That should handle it better.

Dick