Files
nsg_ansible/roles/deploy-be-portal/tasks/switch.yml
T

21 lines
715 B
YAML
Raw Normal View History

2025-03-04 10:06:53 +07:00
# 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 }}"
2025-03-04 10:06:53 +07:00
# Set ASPNETCORE_ENVIRONMENT cho site IIS
- name: Set ASPNETCORE_ENVIRONMENT for IIS site
2025-03-04 09:44:41 +07:00
win_shell: |
Import-Module WebAdministration
Add-WebConfigurationProperty -pspath "MACHINE/WEBROOT/APPHOST/{{ iis_site_name }}" `
2025-03-04 09:47:28 +07:00
-filter "system.webServer/aspNetCore/environmentVariables" `
-name "." `
2025-03-04 09:44:41 +07:00
-value @{name="ASPNETCORE_ENVIRONMENT"; value="{{ aspnetcore_environment }}"}
# - name: Restart IIS site to apply changes
# win_iis_website:
# name: "{{ iis_site_name }}"
# state: restarted