Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0946e4406e | |||
| 3b9e357b6b | |||
| ef177a195d | |||
| fb39e282f7 | |||
| fcc3a5ad3d | |||
| ea5010d9a9 | |||
| ff32e21b51 | |||
| ae3d8934e6 | |||
| afea1ef08a | |||
| bcea81d908 | |||
| 0375ab6efb | |||
| 4aeacb1d82 | |||
| 8fc17fc09f | |||
| f61855de2f | |||
| 3f94dfe6f1 | |||
| 689dcb50a5 | |||
| fd2771e574 | |||
| d6d726e48d |
@@ -1,3 +1,4 @@
|
|||||||
[defaults]
|
[defaults]
|
||||||
inventory = ./inventory
|
inventory = ./inventory
|
||||||
roles_path = ./roles
|
roles_path = ./roles
|
||||||
|
error_on_missing_hosts = True ;Ansible sẽ thoát với mã lỗi 1 nếu không tìm thấy hosts.
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
[beta-acp-backend-webservers]
|
|
||||||
beta-acp-backend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
|
|
||||||
[beta-portal-backend-webservers]
|
|
||||||
beta-portal-backend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
|
|
||||||
[beta-acp-frontend-webservers]
|
|
||||||
beta-acp-frontend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
|
|
||||||
[beta-portal-frontend-webservers]
|
|
||||||
beta-portal-frontend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "acp-api.kinhtedothi.vn"
|
|
||||||
blue_path: "C:\\deploy\\acp\\be\\blue"
|
|
||||||
green_path: "C:\\deploy\\acp\\be\\green"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "tsht.kinhtedothi.vn"
|
|
||||||
blue_path: "C:\\deploy\\acp\\fe\\blue"
|
|
||||||
green_path: "C:\\deploy\\acp\\fe\\green"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "portal-api.kinhtedothi.vn"
|
|
||||||
blue_path: "C:\\deploy\\portal\\be\\blue"
|
|
||||||
green_path: "C:\\deploy\\portal\\be\\green"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "portal-api.hanoitimes.vn"
|
|
||||||
blue_path: "C:\\deploy\\portal\\be\\hnt\\blue"
|
|
||||||
green_path: "C:\\deploy\\portal\\be\\hnt\\green"
|
|
||||||
|
|
||||||
aspnetcore_environment: "Hnt_Beta"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "hanoitimes.vn"
|
|
||||||
blue_path: "C:\\deploy\\portal\\fe\\hnt\\blue"
|
|
||||||
green_path: "C:\\deploy\\portal\\fe\\hnt\\green"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "portal-api.kinhtedothi.vn"
|
|
||||||
blue_path: "C:\\deploy\\portal\\be\\ktdt\\blue"
|
|
||||||
green_path: "C:\\deploy\\portal\\be\\ktdt\\green"
|
|
||||||
|
|
||||||
aspnetcore_environment: "Ktdt_Beta"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "beta.kinhtedothi.vn"
|
|
||||||
blue_path: "C:\\deploy\\portal\\fe\\ktdt\\blue"
|
|
||||||
green_path: "C:\\deploy\\portal\\fe\\ktdt\\green"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "api-acp-2025"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\acp\\be\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\acp\\be\\green"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "uat-acp.vpress.vn"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\acp\\fe\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\acp\\fe\\green"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "api-portal-2025"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\portal\\be\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\portal\\be\\green"
|
|
||||||
|
|
||||||
aspnetcore_environment: "Uat"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "uat-portal2"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\portal\\fe\\hnt\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\portal\\fe\\hnt\\green"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "api-portal-2025"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\portal\\be\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\portal\\be\\green"
|
|
||||||
|
|
||||||
aspnetcore_environment: "Uat"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "uat-portal.vpress.vn"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\portal\\fe\\ktdt\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\portal\\fe\\ktdt\\green"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "resource.vpress.vn"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\resource\\hnt\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\resource\\hnt\\green"
|
|
||||||
|
|
||||||
aspnetcore_environment: "Uat"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
temp_dir: "C:\\deploy\\vpress\\temp"
|
|
||||||
iis_site_name: "resource.vpress.vn"
|
|
||||||
blue_path: "C:\\deploy\\vpress\\resource\\ktdt\\blue"
|
|
||||||
green_path: "C:\\deploy\\vpress\\resource\\ktdt\\green"
|
|
||||||
|
|
||||||
aspnetcore_environment: "Uat"
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "acp-api.kinhtedothi.vn"
|
||||||
|
app_pool_name: "acp-api.kinhtedothi.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\acp\\be\\blue"
|
||||||
|
green_path: "E:\\deploy\\acp\\be\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Ktdt_Production"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "tsht.kinhtedothi.vn"
|
||||||
|
app_pool_name: "tsht.kinhtedothi.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\acp\\fe\\blue"
|
||||||
|
green_path: "E:\\deploy\\acp\\fe\\green"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "portal-api.hanoitimes.vn"
|
||||||
|
app_pool_name: "portal-api.hanoitimes.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\portal\\be\\hnt\\blue"
|
||||||
|
green_path: "E:\\deploy\\portal\\be\\hnt\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Hnt_Production"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "hanoitimes.vn"
|
||||||
|
app_pool_name: "beta.hanoitimes.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\portal\\fe\\hnt\\blue"
|
||||||
|
green_path: "E:\\deploy\\portal\\fe\\hnt\\green"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# temp_dir: "C:\\deploy\\vpress\\temp"
|
||||||
|
# iis_site_name: "cdn-media.hanoitimes.vn"
|
||||||
|
# blue_path: "C:\\deploy\\resource\\hnt\\blue"
|
||||||
|
# green_path: "C:\\deploy\\resource\\hnt\\green"
|
||||||
|
|
||||||
|
# aspnetcore_environment: "Hnt_Production"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "portal-api.kinhtedothi.vn"
|
||||||
|
app_pool_name: "portal-api.kinhtedothi.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\portal\\be\\ktdt\\blue"
|
||||||
|
green_path: "E:\\deploy\\portal\\be\\ktdt\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Ktdt_Production"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "beta.kinhtedothi.vn"
|
||||||
|
app_pool_name: "beta.kinhtedothi.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\portal\\fe\\ktdt\\blue"
|
||||||
|
green_path: "E:\\deploy\\portal\\fe\\ktdt\\green"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# temp_dir: "C:\\deploy\\vpress\\temp"
|
||||||
|
# iis_site_name: "resource.kinhtedothi.vn"
|
||||||
|
# blue_path: "C:\\deploy\\resource\\ktdt\\blue"
|
||||||
|
# green_path: "C:\\deploy\\resource\\ktdt\\green"
|
||||||
|
|
||||||
|
# aspnetcore_environment: "Ktdt_Production"
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
[ktdt_portal_backend]
|
||||||
|
ktdt-portal-backend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[hnt_portal_backend]
|
||||||
|
hnt-portal-backend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[ktdt_portal_frontend]
|
||||||
|
ktdt-portal-frontend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[hnt_portal_frontend]
|
||||||
|
hnt-portal-frontend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[acp_backend]
|
||||||
|
acp-backend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[acp_frontend]
|
||||||
|
acp-frontend ansible_host=123.30.238.12 ansible_user=jenkins_cicd_beta ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[ktdt_resource_backend]
|
||||||
|
ktdt-resource-backend
|
||||||
|
|
||||||
|
[hnt_resource_backend]
|
||||||
|
hnt-resource-backend
|
||||||
|
|
||||||
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[uat-acp-backend-webservers]
|
|
||||||
uat-acp-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
|
|
||||||
[uat-portal-backend-webservers]
|
|
||||||
uat-portal-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
|
|
||||||
[uat-resource-backend-webservers]
|
|
||||||
uat-resource-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
|
|
||||||
[uat-acp-frontend-webservers]
|
|
||||||
uat-acp-frontend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
|
|
||||||
[uat-portal-frontend-webservers]
|
|
||||||
uat-portal-frontend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "api-acp-2025"
|
||||||
|
app_pool_name: "api-acp-2025"
|
||||||
|
blue_path: "E:\\deploy\\vpress\\acp\\be\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\acp\\be\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Uat"
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "uat-acp.vpress.vn"
|
||||||
|
app_pool_name: "uat-acp.vpress.vn"
|
||||||
|
blue_path: "E:\\deploy\\vpress\\acp\\fe\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\acp\\fe\\green"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "api-portal2-2025.vpress.vn"
|
||||||
|
app_pool_name: "api-portal2-2025.vpress.vn"
|
||||||
|
blue_path: "E:\\deploy\\vpress\\portal\\be\\hnt\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\portal\\be\\hnt\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Uat_Hnt"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "uat-portal2"
|
||||||
|
app_pool_name: "uat-portal2"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\vpress\\portal\\fe\\hnt\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\portal\\fe\\hnt\\green"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "resource.vpress.vn"
|
||||||
|
app_pool_name: "resource.vpress.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\vpress\\resource\\hnt\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\resource\\hnt\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Uat"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "api-portal-2025"
|
||||||
|
app_pool_name: "api-portal-2025"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\vpress\\portal\\be\\ktdt\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\portal\\be\\ktdt\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Uat_Ktdt"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "uat-portal.vpress.vn"
|
||||||
|
app_pool_name: "uat-portal.vpress.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\vpress\\portal\\fe\\ktdt\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\portal\\fe\\ktdt\\green"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
temp_dir: "E:\\deploy\\vpress\\temp"
|
||||||
|
iis_site_name: "resource.vpress.vn"
|
||||||
|
app_pool_name: "resource.vpress.vn"
|
||||||
|
|
||||||
|
blue_path: "E:\\deploy\\vpress\\resource\\ktdt\\blue"
|
||||||
|
green_path: "E:\\deploy\\vpress\\resource\\ktdt\\green"
|
||||||
|
|
||||||
|
aspnetcore_environment: "Uat"
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
[ktdt_portal_backend]
|
||||||
|
ktdt-portal-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[hnt_portal_backend]
|
||||||
|
hnt-portal-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[ktdt_portal_frontend]
|
||||||
|
ktdt-portal-frontend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[hnt_portal_frontend]
|
||||||
|
hnt-portal-frontend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[acp_backend]
|
||||||
|
acp-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[acp_frontend]
|
||||||
|
acp-frontend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[ktdt_resource_backend]
|
||||||
|
ktdt-resource-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
[hnt_resource_backend]
|
||||||
|
hnt-resource-backend ansible_host=123.30.172.34 ansible_user=jenkins_cicd ansible_password=Thienthien123@ ansible_connection=winrm ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Deploy Backend for Project ACP
|
||||||
|
hosts: acp-backend
|
||||||
|
roles:
|
||||||
|
- deploy-be-acp
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
- name: Deploy Backend for Project Portal
|
||||||
|
hosts: hnt-portal-backend
|
||||||
|
roles:
|
||||||
|
- deploy-be-portal
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Deploy Backend for Project Resource
|
||||||
|
hosts: hnt-resource-backend
|
||||||
|
roles:
|
||||||
|
- deploy-be-resource
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Deploy Backend for Project Portal
|
||||||
|
hosts: ktdt-portal-backend
|
||||||
|
roles:
|
||||||
|
- deploy-be-portal
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Deploy Backend for Project Resource
|
||||||
|
hosts: ktdt-resource-backend
|
||||||
|
roles:
|
||||||
|
- deploy-be-resource
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
- name: Deploy Backend for Project Acp, Portal
|
|
||||||
hosts: "{{ deploy_env }}-{{project_name}}-backend"
|
|
||||||
roles:
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
- name: Deploy Backend for Project Portal
|
|
||||||
hosts: "{{ deploy_env }}-{{project_name}}-backend"
|
|
||||||
vars:
|
|
||||||
portal_name: "{{ portal_name }}"
|
|
||||||
pre_tasks:
|
|
||||||
- name: Include portal-specific variables
|
|
||||||
include_vars: "../inventory/host_vars/{{ deploy_env }}-{{ project_name }}-{{ portal_name }}-backend.yml"
|
|
||||||
roles:
|
|
||||||
- deploy-be-portal
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
- name: Deploy Backend for Project Resource
|
|
||||||
hosts: "{{ deploy_env }}-{{project_name}}-backend"
|
|
||||||
vars:
|
|
||||||
portal_name: "{{ portal_name }}"
|
|
||||||
pre_tasks:
|
|
||||||
- name: Include portal-specific variables
|
|
||||||
include_vars: "../inventory/host_vars/{{ deploy_env }}-{{ project_name }}-{{ portal_name }}-backend.yml"
|
|
||||||
roles:
|
|
||||||
- deploy-be-resource
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
- name: Deploy Frontend for Project Acp, Portal
|
|
||||||
hosts: "{{ deploy_env }}-{{project_name}}-frontend"
|
|
||||||
roles:
|
|
||||||
- deploy
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
- name: Deploy Frontend for Project Portal
|
|
||||||
hosts: "{{ deploy_env }}-{{project_name}}-frontend"
|
|
||||||
vars:
|
|
||||||
portal_name: "{{ portal_name }}"
|
|
||||||
pre_tasks:
|
|
||||||
- name: Include portal-specific variables
|
|
||||||
include_vars: "../inventory/host_vars/{{ deploy_env }}-{{ project_name }}-{{ portal_name }}-frontend.yml"
|
|
||||||
roles:
|
|
||||||
- deploy-fe-portal
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Deploy FE for Project ACP
|
||||||
|
hosts: acp-frontend
|
||||||
|
roles:
|
||||||
|
- deploy-fe-acp
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Deploy FE for Project Portal ktdt
|
||||||
|
hosts: hnt-portal-frontend
|
||||||
|
roles:
|
||||||
|
- deploy-fe-portal
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- name: Deploy FE for Project Portal ktdt
|
||||||
|
hosts: ktdt-portal-frontend
|
||||||
|
roles:
|
||||||
|
- deploy-fe-portal
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
- name: get_site_current_active_path.yml
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: get_site_current_active_path.yml
|
||||||
|
|
||||||
|
- name: set_target_path
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: set_target_path.yml
|
||||||
|
|
||||||
|
- name: artifact_download
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: artifact_download.yml
|
||||||
|
|
||||||
|
- name: artifact_deploy
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: artifact_deploy.yml
|
||||||
|
|
||||||
|
- name: update_iis_physical_path
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: update_iis_physical_path.yml
|
||||||
|
|
||||||
|
- name: start_iis_app_pool
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: start_iis_app_pool.yml
|
||||||
|
|
||||||
|
- name: set_site_aspnetcore_environment
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: set_site_aspnetcore_environment.yml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -23,6 +23,11 @@
|
|||||||
name: iis_utils
|
name: iis_utils
|
||||||
tasks_from: update_iis_physical_path.yml
|
tasks_from: update_iis_physical_path.yml
|
||||||
|
|
||||||
|
- name: start_iis_app_pool
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: start_iis_app_pool.yml
|
||||||
|
|
||||||
- name: set_site_aspnetcore_environment
|
- name: set_site_aspnetcore_environment
|
||||||
import_role:
|
import_role:
|
||||||
name: iis_utils
|
name: iis_utils
|
||||||
|
|||||||
@@ -23,6 +23,11 @@
|
|||||||
name: iis_utils
|
name: iis_utils
|
||||||
tasks_from: update_iis_physical_path.yml
|
tasks_from: update_iis_physical_path.yml
|
||||||
|
|
||||||
|
- name: start_iis_app_pool
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: start_iis_app_pool.yml
|
||||||
|
|
||||||
- name: set_site_aspnetcore_environment
|
- name: set_site_aspnetcore_environment
|
||||||
import_role:
|
import_role:
|
||||||
name: iis_utils
|
name: iis_utils
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
- name: get_site_current_active_path.yml
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: get_site_current_active_path.yml
|
||||||
|
|
||||||
|
- name: set_target_path
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: set_target_path.yml
|
||||||
|
|
||||||
|
- name: artifact_download
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: artifact_download.yml
|
||||||
|
|
||||||
|
- name: artifact_deploy
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: artifact_deploy.yml
|
||||||
|
|
||||||
|
- name: update_iis_physical_path
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: update_iis_physical_path.yml
|
||||||
|
|
||||||
|
- name: start_iis_app_pool
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: start_iis_app_pool.yml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# Xóa file tạm
|
|
||||||
- name: Clean up temporary files
|
|
||||||
win_file:
|
|
||||||
path: "{{ temp_dir }}\\{{ artifact_name }}"
|
|
||||||
state: absent
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# Tải artifact từ Nexus
|
|
||||||
- name: Download artifact from Nexus
|
|
||||||
win_get_url:
|
|
||||||
url: "{{ nexus_url }}/{{ artifact_name }}"
|
|
||||||
dest: "{{ temp_dir }}\\{{ artifact_name }}"
|
|
||||||
validate_certs: no
|
|
||||||
url_username: "{{ nexus_username }}"
|
|
||||||
url_password: "{{ nexus_password }}"
|
|
||||||
register: download_status
|
|
||||||
vars:
|
|
||||||
nexus_url: "{{ nexus_url }}"
|
|
||||||
artifact_name: "{{ artifact_name }}"
|
|
||||||
nexus_username: "{{ nexus_username }}"
|
|
||||||
nexus_password: "{{ nexus_password }}"
|
|
||||||
|
|
||||||
# Debug download_status
|
|
||||||
- name: Debug download_status
|
|
||||||
debug:
|
|
||||||
var: download_status
|
|
||||||
|
|
||||||
- name: Check if the download was successful
|
|
||||||
debug:
|
|
||||||
msg: "Download successful: {{ download_status.msg }}"
|
|
||||||
|
|
||||||
# Kiểm tra ở trên server đã tồn tại file vùa tải xuống không
|
|
||||||
- name: Check if the artifact file exists
|
|
||||||
stat:
|
|
||||||
path: "{{ temp_dir }}/{{ artifact_name }}"
|
|
||||||
register: file_status
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
|
|
||||||
# Debug file_status
|
|
||||||
- name: Debug file_status
|
|
||||||
debug:
|
|
||||||
var: file_status
|
|
||||||
|
|
||||||
|
|
||||||
# Giải nén artifact vào thư mục target
|
|
||||||
- name: Deploy to target environment
|
|
||||||
win_unzip:
|
|
||||||
src: "{{ temp_dir }}\\{{ artifact_name }}"
|
|
||||||
dest: "{{ target_path }}"
|
|
||||||
overwrite: yes
|
|
||||||
|
|
||||||
@@ -1,13 +1,31 @@
|
|||||||
- name: Setup environment
|
- name: get_site_current_active_path.yml
|
||||||
import_tasks: setup.yml
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: get_site_current_active_path.yml
|
||||||
|
|
||||||
- name: Deploy application
|
- name: set_target_path
|
||||||
import_tasks: deploy.yml
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: set_target_path.yml
|
||||||
|
|
||||||
- name: Clean up temporary files
|
- name: artifact_download
|
||||||
import_tasks: cleanup.yml
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: artifact_download.yml
|
||||||
|
|
||||||
- name: Switch
|
- name: artifact_deploy
|
||||||
import_tasks: switch.yml
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: artifact_deploy.yml
|
||||||
|
|
||||||
|
- name: update_iis_physical_path
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: update_iis_physical_path.yml
|
||||||
|
|
||||||
|
- name: start_iis_app_pool
|
||||||
|
import_role:
|
||||||
|
name: iis_utils
|
||||||
|
tasks_from: start_iis_app_pool.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
#Debug
|
|
||||||
- name: Debug iis_site_name
|
|
||||||
debug:
|
|
||||||
var: iis_site_name
|
|
||||||
|
|
||||||
- name: Debug blue_path
|
|
||||||
debug:
|
|
||||||
var: blue_path
|
|
||||||
|
|
||||||
# Kiểm tra các thông số Nexus
|
|
||||||
- name: Debug Nexus URL
|
|
||||||
debug:
|
|
||||||
var: nexus_url
|
|
||||||
|
|
||||||
- name: Debug artifact name
|
|
||||||
debug:
|
|
||||||
var: artifact_name
|
|
||||||
|
|
||||||
#Lấy đường dẫn vật lý của iis site
|
|
||||||
- name: Get the physical path of the current IIS site
|
|
||||||
win_shell: |
|
|
||||||
Import-Module WebAdministration
|
|
||||||
$site = Get-Website -Name "{{ iis_site_name}}"
|
|
||||||
$site.PhysicalPath
|
|
||||||
register: active_path
|
|
||||||
- debug:
|
|
||||||
var: active_path
|
|
||||||
|
|
||||||
- name: Handle error if active_path is null
|
|
||||||
fail:
|
|
||||||
msg: "The IIS site active path could not be determined."
|
|
||||||
when: active_path.stdout is not defined or active_path.stdout == ''
|
|
||||||
|
|
||||||
|
|
||||||
# Chuẩn hóa giá trị của active_path
|
|
||||||
- name: Normalize active_path
|
|
||||||
set_fact:
|
|
||||||
active_path: "{{ active_path.stdout | trim }}"
|
|
||||||
- debug:
|
|
||||||
var: active_path
|
|
||||||
|
|
||||||
# Chọn môi trường Blue hoặc Green để deploy
|
|
||||||
- name: Set target deployment environment
|
|
||||||
set_fact:
|
|
||||||
target_path: "{{ green_path if active_path == blue_path else blue_path }}" #lấy ra đường dẫn thư mục cần deploy
|
|
||||||
- debug:
|
|
||||||
var: target_path
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
- name: Update site IIS web application
|
|
||||||
win_iis_website:
|
|
||||||
name: "{{ iis_site_name }}"
|
|
||||||
physical_path: "{{ target_path }}"
|
|
||||||
|
|
||||||
# - name: Restart IIS site to apply changes
|
|
||||||
# win_iis_website:
|
|
||||||
# name: "{{ iis_site_name }}"
|
|
||||||
# state: restarted
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# Xóa file tạm
|
|
||||||
- name: Clean up temporary files
|
|
||||||
win_file:
|
|
||||||
path: "{{ temp_dir }}\\{{ artifact_name }}"
|
|
||||||
state: absent
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
# Kiểm tra kết nối Nexus
|
|
||||||
- name: Check Nexus connectivity
|
|
||||||
uri:
|
|
||||||
url: "{{ nexus_url }}"
|
|
||||||
method: GET
|
|
||||||
return_content: yes
|
|
||||||
status_code: 200
|
|
||||||
register: nexus_response
|
|
||||||
|
|
||||||
- name: Verify Nexus response
|
|
||||||
fail:
|
|
||||||
msg: "Unable to connect to Nexus at {{ nexus_url }}"
|
|
||||||
when: nexus_response.status != 200
|
|
||||||
|
|
||||||
# Kiểm tra quyền ghi trên thư mục target
|
|
||||||
- name: Verify write access to target path
|
|
||||||
win_acl:
|
|
||||||
path: "{{ target_path }}"
|
|
||||||
state: query
|
|
||||||
register: acl_status
|
|
||||||
|
|
||||||
- name: Ensure target path is writable
|
|
||||||
fail:
|
|
||||||
msg: "No write permissions for target path: {{ target_path }}"
|
|
||||||
when: acl_status.permissions | length == 0
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# Tải artifact từ Nexus
|
|
||||||
- name: Download artifact from Nexus
|
|
||||||
win_get_url:
|
|
||||||
url: "{{ nexus_url }}/{{ artifact_name }}"
|
|
||||||
dest: "{{ temp_dir }}\\{{ artifact_name }}"
|
|
||||||
validate_certs: no
|
|
||||||
url_username: "{{ nexus_username }}"
|
|
||||||
url_password: "{{ nexus_password }}"
|
|
||||||
register: download_status
|
|
||||||
vars:
|
|
||||||
nexus_url: "{{ nexus_url }}"
|
|
||||||
artifact_name: "{{ artifact_name }}"
|
|
||||||
nexus_username: "{{ nexus_username }}"
|
|
||||||
nexus_password: "{{ nexus_password }}"
|
|
||||||
|
|
||||||
# Debug download_status
|
|
||||||
- name: Debug download_status
|
|
||||||
debug:
|
|
||||||
var: download_status
|
|
||||||
|
|
||||||
- name: Check if the download was successful
|
|
||||||
debug:
|
|
||||||
msg: "Download successful: {{ download_status.msg }}"
|
|
||||||
|
|
||||||
# Kiểm tra ở trên server đã tồn tại file vùa tải xuống không
|
|
||||||
- name: Check if the artifact file exists
|
|
||||||
stat:
|
|
||||||
path: "{{ temp_dir }}/{{ artifact_name }}"
|
|
||||||
register: file_status
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
|
|
||||||
# Debug file_status
|
|
||||||
- name: Debug file_status
|
|
||||||
debug:
|
|
||||||
var: file_status
|
|
||||||
|
|
||||||
|
|
||||||
# Giải nén artifact vào thư mục target
|
|
||||||
- name: Deploy to target environment
|
|
||||||
win_unzip:
|
|
||||||
src: "{{ temp_dir }}\\{{ artifact_name }}"
|
|
||||||
dest: "{{ target_path }}"
|
|
||||||
overwrite: yes
|
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
- name: Setup environment
|
|
||||||
import_tasks: setup.yml
|
|
||||||
|
|
||||||
# - name: Run common checks
|
|
||||||
# import_tasks: common.yml
|
|
||||||
|
|
||||||
- name: Deploy application
|
|
||||||
import_tasks: deploy.yml
|
|
||||||
|
|
||||||
- name: Clean up temporary files
|
|
||||||
import_tasks: cleanup.yml
|
|
||||||
|
|
||||||
- name: Switch
|
|
||||||
import_tasks: switch.yml
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
#Debug
|
|
||||||
- name: Debug iis_site_name
|
|
||||||
debug:
|
|
||||||
var: iis_site_name
|
|
||||||
|
|
||||||
- name: Debug blue_path
|
|
||||||
debug:
|
|
||||||
var: blue_path
|
|
||||||
|
|
||||||
# Kiểm tra các thông số Nexus
|
|
||||||
- name: Debug Nexus URL
|
|
||||||
debug:
|
|
||||||
var: nexus_url
|
|
||||||
|
|
||||||
- name: Debug artifact name
|
|
||||||
debug:
|
|
||||||
var: artifact_name
|
|
||||||
|
|
||||||
#Lấy đường dẫn vật lý của iis site
|
|
||||||
- name: Get the physical path of the current IIS site
|
|
||||||
win_shell: |
|
|
||||||
Import-Module WebAdministration
|
|
||||||
$site = Get-Website -Name "{{ iis_site_name }}"
|
|
||||||
$site.PhysicalPath
|
|
||||||
register: active_path
|
|
||||||
- debug:
|
|
||||||
var: active_path
|
|
||||||
|
|
||||||
- name: Handle error if active_path is null
|
|
||||||
fail:
|
|
||||||
msg: "The IIS site active path could not be determined."
|
|
||||||
when: active_path.stdout is not defined or active_path.stdout == ''
|
|
||||||
|
|
||||||
|
|
||||||
# Chuẩn hóa giá trị của active_path
|
|
||||||
- name: Normalize active_path
|
|
||||||
set_fact:
|
|
||||||
active_path: "{{ active_path.stdout | trim }}"
|
|
||||||
- debug:
|
|
||||||
var: active_path
|
|
||||||
|
|
||||||
# Chọn môi trường Blue hoặc Green để deploy
|
|
||||||
- name: Set target deployment environment
|
|
||||||
set_fact:
|
|
||||||
target_path: "{{ green_path if active_path == blue_path else blue_path }}" #lấy ra đường dẫn thư mục cần deploy
|
|
||||||
- debug:
|
|
||||||
var: target_path
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
- name: Update IIS web application path
|
|
||||||
win_iis_website:
|
|
||||||
name: "{{ iis_site_name }}"
|
|
||||||
physical_path: "{{ target_path }}"
|
|
||||||
|
|
||||||
# - name: Restart IIS site to apply changes
|
|
||||||
# win_iis_website:
|
|
||||||
# name: "{{ iis_site_name }}"
|
|
||||||
# state: restarted
|
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
- name: Validate variables
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- app_pool_name is defined and app_pool_name | length > 0
|
||||||
|
fail_msg: "Thiếu hoặc rỗng biến cần thiết để start_iis_app_pool.yml!"
|
||||||
|
|
||||||
|
# Start app pool
|
||||||
|
- name: Start IIS App Pool
|
||||||
|
win_iis_webapppool:
|
||||||
|
name: "{{ app_pool_name }}"
|
||||||
|
state: started
|
||||||
Reference in New Issue
Block a user