mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-19 01:26:50 +02:00
Added kafka and springBoot roles, minor cleanup, and use ansible-vault to hide sensitive data
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: docker
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: Create Kafka directory
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: /opt/kafka
|
||||
owner: root
|
||||
group: root
|
||||
mode: "755"
|
||||
- name: Copy docker compose file for kafka
|
||||
ansible.builtin.template:
|
||||
src: opt/kafka/docker-compose.yaml.j2
|
||||
dest: /opt/kafka/docker-compose.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: "644"
|
||||
lstrip_blocks: true
|
||||
- name: Create Kafka network
|
||||
community.docker.docker_network:
|
||||
name: kafka
|
||||
state: present
|
||||
appends: true
|
||||
- name: Start kafka docker container
|
||||
community.docker.docker_compose:
|
||||
project_src: /opt/kafka
|
||||
@@ -0,0 +1,41 @@
|
||||
version: '2'
|
||||
services:
|
||||
zookeeper:
|
||||
image: confluentinc/cp-zookeeper:latest
|
||||
restart: always
|
||||
environment:
|
||||
ZOOKEEPER_CLIENT_PORT: 2181
|
||||
ZOOKEEPER_TICK_TIME: 2000
|
||||
expose:
|
||||
- "2181"
|
||||
networks:
|
||||
- kafka
|
||||
|
||||
kafka:
|
||||
image: confluentinc/cp-kafka:latest
|
||||
depends_on:
|
||||
- zookeeper
|
||||
expose:
|
||||
- "9092"
|
||||
networks:
|
||||
- kafka
|
||||
restart: always
|
||||
environment:
|
||||
KAFKA_BROKER_ID: 1
|
||||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
||||
KAFKA_LISTENERS: PLAINTEXT://kafka:9092
|
||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
|
||||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
|
||||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
|
||||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
||||
|
||||
kafkacat:
|
||||
image: confluentinc/cp-kafkacat:7.0.10
|
||||
command: sleep infinity
|
||||
networks:
|
||||
- kafka
|
||||
|
||||
networks:
|
||||
kafka:
|
||||
name: kafka
|
||||
external: true
|
||||
Reference in New Issue
Block a user