title: ansible: 'dict object' has no attribute 'port'
body: <p>i'm trying to run the ansible-kafka playbook clone from the github repo and happen to be receiving below 'dict object' has no attribute 'port'</p>
  
  <p>where am i going wrong with this </p>
  
  <p>github repo : <a href="https://github.com/jaytaylor/ansible-kafka" rel="nofollow noreferrer">https://github.com/jaytaylor/ansible-kafka</a></p>
  
  <p>playbook.yml</p>
  
  <pre><code>---
  
  - hosts: dev
  
    roles:
     - ansible-kafka
  
    vars:
      zookeeper_hosts: "kafka-d1:2181,kafka-d2:2181,kafka-d3:2181"
      kafka_zookeeper_hosts: [ 'kafka-d1','kafka-d2','kafka-d3' ]
      kafka_zookeeper_port: 2181
      kafka_hosts:
        - dev
      kafka_healthcheck_address: "kafka-d1:2181,kafka-d2:2181,kafka-d3:2181/kafka"
      kafka_server_port: 9092
      kafka_connection_string: [ 'kafka-d1','kafka-d2','kafka-d3' ]
  
  - name: "Generate the kafka hosts connection string"
    set_fact: kafka_connection_string="{{ kafka_hosts | join(':' ~ kafka_server.port ~ ',') }}:{{ kafka_server.port }}"
  </code></pre>
  
  <blockquote>
    <p>TASK [ansible-kafka : Generate the kafka hosts connection string]
    ******************************************************************************************** fatal: [kafka-d1]: FAILED! => {"msg": "The task includes an option
    with an undefined variable. The error was: 'dict object' has no
    attribute 'port'\n\nThe error appears to have been in
    '/home/ahshan.md/ansible/ansible-kafka/tasks/kafka-cfg.yml': line 31,
    column 3, but may\nbe elsewhere in the file depending on the exact
    syntax problem.\n\nThe offending line appears</p>
  </blockquote>