master.yml 1017 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
  - name: Configure Apache kafka.
    copy: src=usr/local/kafka/config/server.properties dest=/usr/local/kafka/config/server.properties owner=root group=root mode=0644
    tags:
      - configure-kafka

  - name: Start Apache Zookeeper server.
    shell: /usr/local/kafka/bin/zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties
    async: 31536000 # Stay alive for a year(1 year = 31536000 seconds).
    poll: 0
    tags:
      - start-zookeeper

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

  - name: Start Apache Kafka server.
    shell: /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties
    async: 31536000 # Stay alive for a year(1 year = 31536000 seconds).
    poll: 0
    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