Files
nsg_ansible/roles/deploy-be-portal/tasks/switch.yml
T
thienqb123456 f94804e277 fix10
2025-03-04 10:06:53 +07:00

21 lines
715 B
YAML

# Cập nhật PhysicalPath mới cho site IIS (green/blue)
- name: Update site IIS web application
win_iis_website:
name: "{{ iis_site_name }}"
physical_path: "{{ target_path }}"
# Set ASPNETCORE_ENVIRONMENT cho site IIS
- name: Set ASPNETCORE_ENVIRONMENT for IIS site
win_shell: |
Import-Module WebAdministration
Add-WebConfigurationProperty -pspath "MACHINE/WEBROOT/APPHOST/{{ iis_site_name }}" `
-filter "system.webServer/aspNetCore/environmentVariables" `
-name "." `
-value @{name="ASPNETCORE_ENVIRONMENT"; value="{{ aspnetcore_environment }}"}
# - name: Restart IIS site to apply changes
# win_iis_website:
# name: "{{ iis_site_name }}"
# state: restarted