websoft9/apps/roles/kafka/tasks/pre.yml

47 lines
1018 B
YAML
Raw Normal View History

2022-07-22 10:31:49 +08:00
- pause:
prompt: |
Choice Kafka version:
0: Kafka3.2
1: Kafka3.1
2: Kafka3.0
3: Kafka2.8
2022-07-27 11:16:10 +08:00
4: Kafka2.7
5: Kafka2.6
6: Kafka2.5
7: Kafka2.4
8: Kafka2.3
9: Kafka2.2
10: Kafka2.1
11: Kafka2.0
12: Kafka1.1
13: Kafka1.0
2022-07-22 10:31:49 +08:00
private: no
Default:0
register: kafka_version_options
2022-07-15 08:56:27 +08:00
2022-07-22 10:31:49 +08:00
- set_fact:
kafka_version_meta:
"0": "3.2"
2022-07-26 08:35:22 +08:00
"1": "3.1"
2022-07-22 10:31:49 +08:00
"2": "3.0"
"3": "2.8"
2022-07-27 11:16:10 +08:00
"4": "2.7.0"
"5": "2.6.0"
"6": "2.5.0"
"7": "2.4.0"
"8": "2.3.0"
"9": "2.2.0"
"10": "2.1.0"
"11": "2.0.0"
"12": "1.1.0"
"13": "1.0.0-r5"
2022-07-22 10:31:49 +08:00
- set_fact:
kafka_version: "{{kafka_version_meta[kafka_version_options.user_input]}}"
- debug:
msg: "kafka_version is {{kafka_version}}"
- name: Config .env for start containers
shell: |
2022-07-27 11:05:19 +08:00
sed -i 's/APP_VERSION=.*/APP_VERSION={{kafka_version}}/g' {{installpath}}/{{appname}}/.env