Hello Ansible Gurus,

Any inputs for me to resolve this issue. 

On Friday, September 20, 2019 at 1:07:20 PM UTC+5:30, Srinivas Naram wrote:
>
> Hello Ansible Gurus,
>
> I am new to Ansible and trying to get my hands dirty on playbooks. I wrote 
> an yaml file to use a variable from one host tasks to another. Here is my 
> code ( logically this code may not make sense in real world, I am trying to 
> understand features in Ansible ) 
>
>
> ------------------------------------------------------------------------------------
> ---
> -
>   hosts: modified_user1
>   tasks:
>     -
>       name: "test connection"
>       ping: 
>       register: result
>     -
>       debug:
>         var: result
>       when: result is succeeded
>     -
>       file:
>        path: "/home/ansible_user/from_controller3/file_name"
>        state: touch
>       when: result is succeeded
>
> -
>   hosts: modified_user2
>   tasks:
>     - name: "create a file in the directory"
>       file:
>        path: "/home/ansible_user/from_controller4/file_name"
>        state: touch
>       when: result is succeeded
>     -
>       debug:
>        var: result
>
> ----------------------------------------------------
>
> Is there a provision to pass 'result' variable to second host ?
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/80be1d22-9fa5-4325-9790-09eed1e192d3%40googlegroups.com.

Reply via email to