be-portal env

This commit is contained in:
thienqb123456
2025-03-03 16:23:31 +07:00
parent 965d8b431c
commit ad216b4fef
2 changed files with 12 additions and 14 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
- name: Deploy Backend for Project Acp, Portal - name: Deploy Backend for Project Portal
hosts: "{{ deploy_env }}-{{project_name}}-backend" hosts: "{{ deploy_env }}-{{project_name}}-backend"
vars: vars:
portal_name: "{{ portal_name }}" portal_name: "{{ portal_name }}"
+11 -13
View File
@@ -24,19 +24,17 @@
debug: debug:
var: artifact_name var: artifact_name
- name: Set environment variable for IIS App Pool - name: Set registry key for IIS App Pool environment variable
hosts: windows_servers win_regedit:
tasks: path: "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\W3SVC\\AppPools\\{{ iis_app_pool }}\\Environment"
- name: Thiết lập ASPNETCORE_ENVIRONMENT cho App Pool name: "TEST_ENV"
win_shell: | type: string
$appPoolName = "{{ iis_app_pool }}" data: "{{ aspnetcore_environtment }}"
$envVarName = "ASPNETCORE_ENVIRONMENT"
$envVarValue = "{{ aspnetcore_environtment }}" - name: Khởi động lại App Pool (hoặc IIS) để áp dụng
$appPool = Get-Item "IIS:\AppPools\$appPoolName" win_iis_webapppool:
$appPool.EnvironmentVariables[$envVarName] = $envVarValue name: "{{ iis_app_pool }}"
$appPool | Set-Item state: restarted
args:
executable: powershell.exe
#Lấy đường dẫn vật lý của iis site #Lấy đường dẫn vật lý của iis site
- name: Get the physical path of the current IIS site - name: Get the physical path of the current IIS site