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

42 lines
921 B
YAML
Raw Normal View History

2022-07-19 15:03:00 +08:00
- pause:
prompt: |
Choice MongoDB version:
0: MongoDB5.0
1: MongoDB4.4
2: MongoDB4.2
2022-08-02 10:57:23 +08:00
3: MongoDB4.0
4: MongoDB3.7
5: MongoDB3.6
6: MongoDB3.5
7: MongoDB3.4
8: MongoDB3.3
2022-08-11 16:42:06 +08:00
9: MongoDB3.2
2022-12-20 14:51:46 +08:00
10MongoDB6.0
2022-07-19 15:03:00 +08:00
private: no
Default:0
register: mongodb_version_options
2022-07-15 08:56:27 +08:00
2022-07-19 15:03:00 +08:00
- set_fact:
mongodb_version_meta:
"0": "5.0"
"1": "4.4"
"2": "4.2"
2022-08-02 10:57:23 +08:00
"3": "4.0"
"4": "3.7"
"5": "3.6"
"6": "3.5"
2022-08-11 16:42:06 +08:00
"7": "3.4"
2022-08-02 10:57:23 +08:00
"8": "3.3"
2022-08-11 16:42:06 +08:00
"9": "3.2"
2022-12-20 14:51:46 +08:00
"10": "6.0"
2022-07-19 15:03:00 +08:00
- set_fact:
mongodb_version: "{{mongodb_version_meta[mongodb_version_options.user_input]}}"
- debug:
msg: "mongodb_version is {{mongodb_version}}"
- name: Config .env for start containers
shell: |
2022-07-19 15:52:39 +08:00
sed -i 's/APP_VERSION=.*/APP_VERSION={{mongodb_version}}/g' {{installpath}}/{{appname}}/.env