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

36 lines
766 B
YAML
Raw Normal View History

2022-07-22 09:00:27 +08:00
- pause:
prompt: |
Choice Haproxy version:
0: Haproxy2.6
1: Haproxy2.5
2: Haproxy2.4
3: Haproxy2.3
4: Haproxy2.2
5: Haproxy2.0
2023-01-28 10:39:32 +08:00
6: Haproxy2.7
7: Haproxy2.8
2022-07-22 09:00:27 +08:00
private: no
Default:0
register: haproxy_version_options
2022-07-22 08:53:10 +08:00
2022-07-22 09:00:27 +08:00
- set_fact:
haproxy_version_meta:
"0": "2.6"
"1": "2.5"
"2": "2.4"
"3": "2.3"
"4": "2.2"
"5": "2.0"
2023-01-28 10:39:32 +08:00
"6": "2.7"
"7": "2.8"
2022-07-22 09:00:27 +08:00
- set_fact:
haproxy_version: "{{haproxy_version_meta[haproxy_version_options.user_input]}}"
- debug:
msg: "haproxy_version is {{haproxy_version}}"
- name: Config .env for start containers
shell: |
2022-07-26 10:26:19 +08:00
sed -i 's/APP_VERSION=.*/APP_VERSION={{haproxy_version}}/g' {{installpath}}/{{appname}}/.env