websoft9/apps/roles/redis/tasks/pre.yml
2022-10-12 14:48:38 +08:00

36 lines
773 B
YAML

- pause:
prompt: |
Choice Redis version:
0: Redis7.0
1: Redis6.2
2: Redis6.0
3: Redis5.0
4: Redis4.0
5: Redis3.2
6: Redis3.0
7: Redis2.8
private: no
Default:0
register: redis_version_options
- set_fact:
redis_version_meta:
"0": "7.0"
"1": "6.2"
"2": "6.0"
"3": "5.0"
"4": "4.0"
"5": "3.2"
"6": "3.0"
"7": "2.8"
- set_fact:
redis_version: "{{redis_version_meta[redis_version_options.user_input]}}"
- debug:
msg: "redis_version is {{redis_version}}"
- name: Config .env for start containers
shell: |
sed -i 's/APP_VERSION=.*/APP_VERSION={{redis_version}}/g' {{installpath}}/{{appname}}/.env