On 03/07/2021 06:36, Joey Cheng wrote:
> 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?
>
I think the "command" module doesn't use a shell at all, it executes the command from a Python skript.
That also means it doesn't read any of the bash configuration files, thus relevant environment variables
might be missing. Also check whether the task above uses the same user as the direct bash invocation.
Regards
Racke
> --
> 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
ansible-proje...@googlegroups.com <mailto:
ansible-proje...@googlegroups.com>.
> 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>.
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.