-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.47 KB
/
ansible_kafka_cluster.yaml
File metadata and controls
49 lines (39 loc) · 1.47 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Ansible Kafka Cluster Installation
on:
push:
branches:
- main
paths:
- 'terraform/**'
- 'ansible_kafka_cluster/**'
jobs:
ansible:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run Ansible in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
-e SSH_PRIVATE_KEY="${{ secrets.EC2 }}" \
python:3.11-slim bash -c "
set -e
# Sistem paketlerini kur
apt-get update && apt-get install -y ansible awscli jq ssh git
# Confluent Platform koleksiyonunu yükle
ansible-galaxy collection install confluent.platform
# SSH key oluştur ve izinleri ayarla
mkdir -p ~/.ssh
echo \"\$SSH_PRIVATE_KEY\" > ~/.ssh/trendyol-kafka-key.pem
chmod 600 ~/.ssh/trendyol-kafka-key.pem
# Inventory oluştur
bash ansible_kafka_cluster/generate-ansible-inventory.sh
# Test ping
ansible all -i ansible_kafka_cluster/inventory.yml -m ping
# Playbook çalıştır
ansible-playbook -i ansible_kafka_cluster/cp-ansible-inventory.yml confluent.platform.all
"