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

36 lines
1.0 KiB
YAML
Raw Normal View History

2022-07-25 11:31:57 +08:00
- pause:
prompt: |
Choice Baota version:
0: Baota English version
1: Baota Chinese version
private: no
Default:0
register: baota_version_options
- set_fact:
baota_version_meta:
"0": "aapanel/aapanel"
"1": "btpanel/baota"
- set_fact:
baota_version: "{{baota_version_meta[baota_version_options.user_input]}}"
- debug:
msg: "baota_version is {{baota_version}}"
2022-07-26 11:05:16 +08:00
- name: Config .env and docker-compose for aapanel
2022-07-26 10:02:03 +08:00
shell: |
sed -i 's/APP_REPO=.*/APP_REPO={{baota_version}}/g' {{installpath}}/{{appname}}/.env
2022-07-26 10:48:35 +08:00
yq eval 'del(.services.aapanel.profiles)' docker-compose.yml > tmp.yml
2022-07-26 10:02:03 +08:00
cat tmp.yml > docker-compose.yml
2022-07-26 10:48:35 +08:00
rm -f tmp.yml
when: baota_version == "aapanel/aapanel"
2022-07-26 11:05:16 +08:00
- name: Config .env and docker-compose for btpanel
2022-07-26 10:48:35 +08:00
shell: |
sed -i 's/APP_REPO=.*/APP_REPO={{baota_version}}/g' {{installpath}}/{{appname}}/.env
2022-07-26 10:49:20 +08:00
yq eval 'del(.services.btpanel.profiles)' docker-compose.yml > tmp.yml
2022-07-26 10:48:35 +08:00
cat tmp.yml > docker-compose.yml
rm -f tmp.yml
when: baota_version == "btpanel/baota"