Skip to content

Instantly share code, notes, and snippets.

@nithyadurai87
Created November 23, 2020 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nithyadurai87/b5e4d94f36ca08f38dba8de470b22e43 to your computer and use it in GitHub Desktop.
Save nithyadurai87/b5e4d94f36ca08f38dba8de470b22e43 to your computer and use it in GitHub Desktop.
- hosts: all
vars:
url: "https://downloads.apache.org/kafka/2.5.0/kafka_2.12-2.5.0.tgz"
become: true
tasks:
- name: kafka steps
shell:
cmd: mkdir kafka_test
cmd: mkdir /opt/kafka_test
cmd: rmdir kafka_test
cmd: cd /opt/kafka_test
cmd: wget "{{url}}"
cmd: tar -xzf kafka_2.12-2.5.0.tgz
cmd: cd kafka_2.12-2.5.0/config/
cmd: echo "listeners=PLAINTEXT://localhost:9092" >> server.properties
notify:
- start services
- stop services
handlers:
- name: start services
shell:
cmd: /opt/kafka_test/kafka_2.12-2.5.0/bin/zookeeper-server-start.sh /opt/kafka_test/kafka_2.12-2.5.0/config/zookeeper.properties &
- name: stop services
shell:
cmd: exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment