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

36 lines
785 B
YAML
Raw Normal View History

2022-07-22 09:15:30 +08:00
- pause:
prompt: |
Choice Redis version:
2022-07-26 09:04:30 +08:00
0: Redis7.0
1: Redis6.2
2: Redis6.0
3: Redis5.0
4: Redis4.0
5: Redis3.2
6: Redis3.0
7: Redis2.8
2022-07-22 09:15:30 +08:00
private: no
Default:0
register: redis_version_options
2022-07-15 08:56:27 +08:00
2022-07-22 09:15:30 +08:00
- set_fact:
redis_version_meta:
2022-07-26 09:04:30 +08:00
"0": "7.0"
"1": "6.2"
"2": "6.0"
"3": "5.0"
"4": "4.0"
"5": "3.2"
"6": "3.0"
"7": "2.8"
2022-07-22 09:15:30 +08:00
- 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: |
2022-07-26 09:15:26 +08:00
sed -i 's/APP_REDIS_VERSION=.*/APP_REDIS_VERSION={{redis_version}}/g' {{installpath}}/{{appname}}/.env