Grega Bremec пре 1 месец
родитељ
комит
ec1117f0c1

+ 3 - 1
playbooks/roles/install-labs/defaults/main.yml

@@ -4,5 +4,7 @@
 lab_sku: ad482
 lab_package: "rht-labs-{{ lab_sku }}"
 lab_index_url: https://pypi.apps.tools-na.prod.nextcle.com/repository/labs/simple/
-lab_files_fixes: []
+lab_files_fixes:
+  - patch: files/kafka-cluster-template.patch
+    target: "{{ ansible_facts['user_dir'] }}/.local/lib/python3.9/site-packages/ad482/common/kubefiles/templates/cluster.yaml"
 ...

+ 22 - 0
playbooks/roles/install-labs/files/kafka-cluster-template.patch

@@ -0,0 +1,22 @@
+--- cluster.yaml-orig	2025-05-29 08:23:09.286814851 -0400
++++ cluster.yaml	2025-05-29 08:14:35.748238943 -0400
+@@ -11,7 +11,7 @@
+       name: ${CLUSTER_NAME}
+     spec:
+       kafka:
+-        version: 2.8.0
++        version: 3.9.0
+         replicas: "${{BROKER_REPLICAS}}"
+         listeners:
+           - name: plain
+@@ -30,8 +30,8 @@
+           offsets.topic.replication.factor: "${{BROKER_REPLICAS}}"
+           transaction.state.log.replication.factor: "${{BROKER_REPLICAS}}"
+           transaction.state.log.min.isr: "${{TRX_STATE_LOG_MIN_ISR}}"
+-          log.message.format.version: "2.8"
+-          inter.broker.protocol.version: "2.8"
++          log.message.format.version: "3.9"
++          inter.broker.protocol.version: "3.9"
+         storage:
+           type: ephemeral
+       zookeeper:

+ 16 - 0
playbooks/roles/install-labs/tasks/main.yml

@@ -7,6 +7,8 @@
 #   lab_package:        rht-labs-{{ lab_sku }}
 #   lab_index_url:      https://pypi.apps.tools-na.prod.nextcle.com/repository/labs/simple/
 #   lab_files_fixes:    a list of patch files to apply to lab materials
+#     - patch: files/patch.patch
+#       target: some/file.txt
 #
 - name: Upgrade pip
   ansible.builtin.pip:
@@ -41,4 +43,18 @@
 - name: Activate the new labs
   ansible.builtin.shell: "lab select {{ lab_sku }}"
   when: (current_sku is not defined) or (current_sku != lab_sku)
+
+- name: Ensure ansible POSIX collection is there
+  become: yes
+  yum:
+    name:
+      - ansible-collection-ansible-posix
+    state: latest
+
+- name: Apply all the patches to lab resources
+  ansible.posix.patch:
+    src: "{{ item.patch }}"
+    dest: "{{ item.target }}"
+    ignore_whitespace: yes
+  loop: "{{ lab_files_fixes }}"
 ...