Commit e0fc6086 authored by Georgios Ouzounis's avatar Georgios Ouzounis
Browse files

LAM-33 Created variables for the mirror, version and installation path in apache-kafka role.

parent c97163bf
---
- name: create topics
shell: /usr/local/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic input
shell: "{{ installation_path }}/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic input"
notify:
- create batch output topic
- name: create batch output topic
shell: /usr/local/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic batch-output
shell: "{{ installation_path }}/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic batch-output"
notify:
- create stream output topic
- name: create stream output topic
shell: /usr/local/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic stream-output
shell: "{{ installation_path }}/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic stream-output"
---
- name: Download Apache Kafka.
get_url: url=http://mirrors.myaegean.gr/apache/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz dest=/root/kafka_2.10-0.8.2.1.tgz
get_url: url="{{ mirror_url }}/{{ version }}/kafka_{{ scala_version }}-{{ version }}.tgz" dest="{{ download_path }}/kafka_{{ scala_version }}-{{ version }}.tgz"
tags:
- download
- name: Uncompress Apache Kafka.
unarchive: src=/root/kafka_2.10-0.8.2.1.tgz dest=/usr/local copy=no
unarchive: src="{{ download_path }}/kafka_{{ scala_version }}-{{ version }}.tgz" dest="{{ installation_path }}" copy=no
tags:
- download
- name: Create softlink for Apache Kafka.
file: src=/usr/local/kafka_2.10-0.8.2.1 dest=/usr/local/kafka state=link
file: src="{{ installation_path }}/kafka_{{ scala_version }}-{{ version }}" dest="{{ installation_path }}/kafka" state=link
tags:
- download
---
- 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
copy: src=server.properties dest="{{ installation_path }}/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
shell: "{{ installation_path }}/kafka/bin/zookeeper-server-start.sh {{ installation_path }}/kafka/config/zookeeper.properties"
async: 31536000 # Stay alive for a year(1 year = 31536000 seconds).
poll: 0
tags:
......@@ -17,7 +17,7 @@
- start-zookeeper
- name: Start Apache Kafka server.
shell: /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties
shell: "{{ installation_path }}/kafka/bin/kafka-server-start.sh {{ installation_path }}/kafka/config/server.properties"
async: 31536000 # Stay alive for a year(1 year = 31536000 seconds).
poll: 0
tags:
......
---
- name: Configure Apache kafka.
template: src=usr/local/kafka/config/server.properties.j2 dest=/usr/local/kafka/config/server.properties owner=root group=root mode=0644
template: src=server.properties.j2 dest="{{ installation_path }}/kafka/config/server.properties" owner=root group=root mode=0644
tags:
- configure-kafka
- name: Start Apache Kafka server.
shell: /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties
shell: "{{ installation_path }}/kafka/bin/kafka-server-start.sh {{ installation_path }}/kafka/config/server.properties"
async: 31536000 # Stay alive for a year(1 year = 31536000 seconds).
poll: 0
tags:
......
---
mirror_url: "http://mirrors.myaegean.gr/apache/kafka"
scala_version: "2.10"
version: "0.8.2.1"
download_path: "/root"
installation_path: "/usr/local"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment