From b57fcb92e0958dd323cfc1dfe3c4f8f63cf38ed3 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Wed, 20 Jul 2022 11:31:44 +0800 Subject: [PATCH] Update install.yml --- apps/tasks/install.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/tasks/install.yml b/apps/tasks/install.yml index 0cc86aa5..0f4c87e0 100644 --- a/apps/tasks/install.yml +++ b/apps/tasks/install.yml @@ -12,12 +12,18 @@ repo: "https://github.com/Websoft9/docker-{{app}}.git" dest: "{{installpath}}/{{app}}" + - name: Check APP_URL_REPLACE exists + shell: | + cat "{{installpath}}/{{app}}/.env" |grep APP_URL_REPLACE=true + register: http_url_exists + failed_when: false + - name: Change Public IP for http_url if APP_URL_REPLACE=true shell: | - wget -N https://raw.githubusercontent.com/Websoft9/StackHub/main/scripts/change_ip.sh - bash change_ip.sh "{{appname}}" - rm -f change_ip.sh - + public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash` + sudo sed -i "s/APP_URL=.*/APP_URL=$public_ip/g" /data/apps/{{app}}/.env + when: http_url_exists.stdout != "" + - name: Excute Preparation if have pre.yml block: - name: Check if pre.yml exists