From 6a29294ddd9d195a5b8882bc2ab27fb9870b53f8 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Mon, 25 Jul 2022 14:38:29 +0800 Subject: [PATCH] Update pre.yml --- apps/roles/postgresql/tasks/pre.yml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/apps/roles/postgresql/tasks/pre.yml b/apps/roles/postgresql/tasks/pre.yml index d3f5a12f..9f49ff8d 100644 --- a/apps/roles/postgresql/tasks/pre.yml +++ b/apps/roles/postgresql/tasks/pre.yml @@ -1 +1,43 @@ +- pause: + prompt: | + Choice PostgreSQL version: + 0: PostgreSQL latest + 1: PostgreSQL 14 + 2: PostgreSQL 13 + 3: PostgreSQL 12 + 4: PostgreSQL 11 + 5: PostgreSQL 10 + 6: PostgreSQL 9.6 + 7: PostgreSQL 9.5 + 8: PostgreSQL 9.4 + 9: PostgreSQL 9.3 + 10: PostgreSQL 9.2 + 11: PostgreSQL 9.1 + private: no + Default:0 + register: postgresql_version_options +- set_fact: + postgresql_version_meta: + "0": "latest" + "1": "14" + "2": "13" + "3": "12" + "4": "11" + "5": "10" + "6": "9.6" + "7": "9.5" + "8": "9.4" + "9": "9.3" + "10": "9.2" + "11": "9.1" + +- set_fact: + postgresql_version: "{{postgresql_version_meta[postgresql_version_options.user_input]}}" + +- debug: + msg: "postgresql_version is {{postgresql_version}}" + +- name: Config .env for start containers + shell: | + sed -i 's/APP_VERSION=.*/APP_VERSION={{postgresql_version}}/g' {{installpath}}/{{appname}}/.env