-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (56 loc) · 2.94 KB
/
Makefile
File metadata and controls
84 lines (56 loc) · 2.94 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.PHONY: help lint test test-tls test-airgap build publish clean install deploy common controllers brokers monitoring kafka-ui topics acls scram health rolling-restart upgrade analysis preflight-airgap
INVENTORY ?= examples/inventory/hosts.yml
PLAYBOOK_DIR := playbooks
ANSIBLE_OPTS ?=
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
# --- Development ---
lint: ## Lint all playbooks and roles
yamllint .
ansible-lint
test: ## Run Molecule default scenario
molecule test -s default
test-tls: ## Run Molecule kraft-tls scenario
molecule test -s kraft-tls
# --- Build & Publish ---
build: ## Build Ansible Galaxy collection tarball
ansible-galaxy collection build --force
publish: build ## Publish collection to Ansible Galaxy (requires GALAXY_TOKEN)
ansible-galaxy collection publish osodevops-kafka_platform-*.tar.gz --api-key $(GALAXY_TOKEN)
clean: ## Remove build artifacts
rm -f osodevops-kafka_platform-*.tar.gz
rm -rf .molecule/
# --- Deployment ---
install: ## Install Ansible Galaxy requirements
ansible-galaxy collection install -r requirements.yml
deploy: ## Full cluster deployment (site.yml)
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/site.yml $(ANSIBLE_OPTS)
common: ## Run common role only (OS prep)
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/common.yml $(ANSIBLE_OPTS)
controllers: ## Deploy KRaft controllers
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/kafka_controller.yml $(ANSIBLE_OPTS)
brokers: ## Deploy Kafka brokers
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/kafka_broker.yml $(ANSIBLE_OPTS)
monitoring: ## Deploy Prometheus + Grafana
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/monitoring.yml $(ANSIBLE_OPTS)
kafka-ui: ## Deploy Kafka UI only
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/site.yml --tags kafka_ui $(ANSIBLE_OPTS)
topics: ## Create Kafka topics
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/create_topics.yml $(ANSIBLE_OPTS)
acls: ## Provision Kafka ACLs
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/create_acls.yml $(ANSIBLE_OPTS)
scram: ## Create SCRAM users
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/create_scram_users.yml $(ANSIBLE_OPTS)
health: ## Run health checks
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/health_check.yml $(ANSIBLE_OPTS)
rolling-restart: ## Rolling restart of cluster
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/rolling_restart.yml $(ANSIBLE_OPTS)
upgrade: ## Upgrade Kafka version
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/upgrade.yml $(ANSIBLE_OPTS)
analysis: ## Analyse Kafka topic configuration (read-only)
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/analysis.yml $(ANSIBLE_OPTS)
# --- Air-Gap ---
preflight-airgap: ## Run air-gap preflight validation
ansible-playbook -i $(INVENTORY) $(PLAYBOOK_DIR)/preflight-airgap.yml $(ANSIBLE_OPTS)
test-airgap: ## Run Molecule air-gap scenario
molecule test -s airgap