Skip to content

Instantly share code, notes, and snippets.

@freemanlutsk
Created July 1, 2018 08:24
Show Gist options
  • Save freemanlutsk/904aebfbd24c39b1bc58c68528a6d6af to your computer and use it in GitHub Desktop.
Save freemanlutsk/904aebfbd24c39b1bc58c68528a6d6af to your computer and use it in GitHub Desktop.
- name: Create a kafka docker container
docker_container:
name: "kafka_docker"
image: wurstmeister/kafka:2.11-0.11.0.2
detach: True
network_mode: host
#command: sh -c 'while sleep 3600; do :; done'
env:
KAFKA_BROKER_ID: 1
KAFKA_ADVERTISED_LISTENERS: INSIDE://localhost:9092,OUTSIDE://kafka1-int-dev.xxx.com:9091
KAFKA_CREATE_TOPICS: "click:1:1"
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_ZOOKEEPER_CONNECT: kafka1-int-dev.xxx.com:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_PORT: 9092
KAFKA_ADVERTISED_PORT: 9091
KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9091
#volumes:
# - "/opt/kafka-log"
restart: yes
state: started
restart_policy: always
- name: Wait a few minutes for the IPs to be set to the container
wait_for: timeout=120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment