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

44 lines
1.0 KiB
YAML
Raw Normal View History

2022-07-25 14:38:29 +08:00
- pause:
prompt: |
Choice PostgreSQL version:
2022-10-20 14:38:42 +08:00
0: PostgreSQL 15
2022-07-25 14:38:29 +08:00
1: PostgreSQL 14
2: PostgreSQL 13
3: PostgreSQL 12
4: PostgreSQL 11
5: PostgreSQL 10
6: PostgreSQL 9.6
7: PostgreSQL 9.5
2022-07-25 14:38:49 +08:00
8: PostgreSQL 9.4
9: PostgreSQL 9.3
10: PostgreSQL 9.2
11: PostgreSQL 9.1
2022-07-25 14:38:29 +08:00
private: no
Default:0
register: postgresql_version_options
2022-07-15 08:56:27 +08:00
2022-07-25 14:38:29 +08:00
- set_fact:
postgresql_version_meta:
2022-10-20 14:38:42 +08:00
"0": "15"
2022-07-25 14:38:29 +08:00
"1": "14"
"2": "13"
"3": "12"
"4": "11"
"5": "10"
2022-07-25 14:38:49 +08:00
"6": "9.6"
2022-07-25 14:38:29 +08:00
"7": "9.5"
"8": "9.4"
"9": "9.3"
"10": "9.2"
"11": "9.1"
2022-07-25 14:39:01 +08:00
2022-07-25 14:38:29 +08:00
- 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: |
2022-07-28 10:44:43 +08:00
sed -i 's/APP_VERSION=.*/APP_VERSION={{postgresql_version}}/g' {{installpath}}/{{appname}}/.env