master.yml 963 Bytes
Newer Older
1
---
2 3 4 5
  - name: Install Apache kafka.
    include: install.yml

  - name: Copy Apache Zookeeper init script.
6
    template: src=zookeeper-init.j2 dest=/etc/init.d/zookeeper-init owner=kafka group=lambda mode=0740
7

8
  - name: Configure Apache kafka.
9
    copy: src=server.properties dest="{{ installation_path }}/kafka/config/server.properties" owner=kafka group=lambda mode=0644
10 11 12 13
    tags:
      - configure-kafka

  - name: Start Apache Zookeeper server.
14
    shell: /etc/init.d/zookeeper-init start > /dev/null &
15 16 17 18 19 20 21 22 23
    tags:
      - start-zookeeper

  - name: Wait for Apache Zookeeper to become available.
    wait_for: port=2181
    tags:
      - start-zookeeper

  - name: Start Apache Kafka server.
24
    shell: /etc/init.d/kafka-init start > /dev/null &
25 26 27 28 29 30 31 32 33 34
    tags:
      - start-kafka

  - name: Wait for Apache Kafka server to become available.
    wait_for: port=9092 timeout=30
    changed_when: true
    notify:
      - create topics
    tags:
      - start-kafka