From af56e448e9f9e667957f64882bbbecdfc31057d0 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Fri, 22 Jul 2022 09:15:30 +0800 Subject: [PATCH] Update pre.yml --- apps/roles/redis/tasks/pre.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/apps/roles/redis/tasks/pre.yml b/apps/roles/redis/tasks/pre.yml index d3f5a12f..4e73660d 100644 --- a/apps/roles/redis/tasks/pre.yml +++ b/apps/roles/redis/tasks/pre.yml @@ -1 +1,25 @@ +- pause: + prompt: | + Choice Redis version: + 0: Redis7 + 1: Redis6 + 2: Redis5 + private: no + Default:0 + register: redis_version_options +- set_fact: + redis_version_meta: + "0": "7" + "1": "6" + "2": "5" + +- 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=v{{redis_version}}/g' {{installpath}}/{{appname}}/.env