Those variables are set on localhost , not kfkahost0.

Why don't you just put your kafka host in a group and use group_vars?

On 7 May 2017 at 20:41,  <madhan0...@gmail.com> wrote:
> I am trying to pass a variables to the hosts in a play
>
> - name: include vars
>   hosts: localhost
>   connection: local
>   tasks:
>     - include_vars:
>         dir: '../group_vars'
>         depth: 1
>
> - name: debug
>   hosts: localhost
>   connection: local
>   tasks:
>     - debug: msg="{{ kfkahost0 }}"
>
> - name: Create topic
>   hosts: "{{ kfkahost0 }}"
>   tasks:
>    # - name: include vars
>    # - include_vars: dir="../group_vars" depth="1"
>           #dir: '../group_vars'
>           #depth: 1
>
>     - shell: ./app/bin/kafka/bin/kafka-topics.sh --zookeeper {{ zkhost0
> }}:2181 --create --topic {{ topic }} --partitions {{ partition }}
> --replication-factor {{ rpfactor }}
>                                                                      42,3
> Bot
>
> in the debug step i see the hostname comes out in the msg fine
>
> but in the next play it says kfkahost0 is undefined.
>
>
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8c3b338e-f073-4fbe-b91d-46de1851d4c3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK5eLPT67nUg8HjLz7LwosbTULkPgxP5%2BeEZUNHOM7BSRt3wHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to