Hello,

Have you tried using shell instead of command?

>From shell docs:

It is almost exactly like the command module but runs the command through a
shell (/bin/sh) on the remote node.

>From command docs:

The command(s) will not be processed through the shell, so variables like
$HOME and operations like "<", ">", "|", ";" and "&" will not work. Use the
shell module if you need these features.

Luca

Il sab 3 lug 2021, 06:36 Joey Cheng <[email protected]> ha scritto:

> Hello folks,
>
> I'm using ansible to deploy Ray cluster. I'm initializing head node as
> following:
>
> * - name: Start Ray on head node*
> *   ansible.builtin.command: ray start --head --port=6379*
> *   environment: *
> *       PATH: /opt/anaconda3/bin*
> *    register: result*
>
> I printed the result and it looks fine. But when I run "ray status" in
> bash, it shows "Could not find any running Ray instance" error. Also, I
> tried typing "ray start --head --port=6379" directly in bash, everything is
> fine.
>
> So why these give different result? What's the difference between the bash
> that I use and the one ansible.builtin.command uses?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a35692da-8ae4-43d1-99e0-a699d18d184cn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/a35692da-8ae4-43d1-99e0-a699d18d184cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKuX69rtBmLCD7f5UyK-YFZpGvSMJzQrB__9WY9RZyEzwcWFNA%40mail.gmail.com.

Reply via email to