diff --git a/TP01/web/httpd.conf b/TP01/web/httpd.conf index 526d142..edf876c 100644 --- a/TP01/web/httpd.conf +++ b/TP01/web/httpd.conf @@ -553,8 +553,12 @@ SSLRandomSeed connect builtin Header set Access-Control-Allow-Origin * ProxyRequests On ProxyPreserveHost On - ProxyPass /api http://backend:8080/ - ProxyPassReverse /api http://backend:8080/ + + BalancerMember "http://backend-1:8080" + BalancerMember "http://backend-2:8080" + + ProxyPass "/api/" "http://serverpool" + ProxyPassReverse "/api/" "http://serverpool" ProxyPass / http://frontend:80/ ProxyPassReverse / http://frontend:80/ diff --git a/TP03/ansible/roles/launch-app/tasks/main.yml b/TP03/ansible/roles/launch-app/tasks/main.yml index 2daad4d..616e180 100644 --- a/TP03/ansible/roles/launch-app/tasks/main.yml +++ b/TP03/ansible/roles/launch-app/tasks/main.yml @@ -1,10 +1,10 @@ --- # tasks file for roles/launch-app - - name: Run App + - name: Run App-1 docker_container: - name: "{{ BACKEND_NAME}}" + name: "{{ BACKEND_NAME}}-1" image: "{{ BACKEND_IMAGE }}" - state: started + state: absent env: DATABASE_URL: "{{ DATABASE_URL }}" POSTGRES_USER: "{{ POSTGRES_USER }}" @@ -12,5 +12,15 @@ POSTGRES_DB: "{{ POSTGRES_DB }}" networks: - name: "{{ NETWORK_NAME }}" - ports: - - "8080:8080" \ No newline at end of file + - name: Run App-2 + docker_container: + name: "{{ BACKEND_NAME}}-2" + image: "{{ BACKEND_IMAGE }}" + state: absent + env: + DATABASE_URL: "{{ DATABASE_URL }}" + POSTGRES_USER: "{{ POSTGRES_USER }}" + POSTGRES_PASSWORD: "{{ POSTGRES_PASSWORD }}" + POSTGRES_DB: "{{ POSTGRES_DB }}" + networks: + - name: "{{ NETWORK_NAME }}" \ No newline at end of file diff --git a/TP03/ansible/roles/launch-database/tasks/main.yml b/TP03/ansible/roles/launch-database/tasks/main.yml index 5e3a3c5..8bd6ae6 100644 --- a/TP03/ansible/roles/launch-database/tasks/main.yml +++ b/TP03/ansible/roles/launch-database/tasks/main.yml @@ -4,7 +4,7 @@ docker_container: name: "{{ DATABASE_NAME }}" image: "{{ DATABASE_IMAGE }}" - state: started + state: absent env: POSTGRES_DB: "{{ POSTGRES_DB }}" POSTGRES_USER: "{{ POSTGRES_USER }}" diff --git a/TP03/ansible/roles/launch-front/tasks/main.yml b/TP03/ansible/roles/launch-front/tasks/main.yml index 5026ad3..7c9d5a1 100644 --- a/TP03/ansible/roles/launch-front/tasks/main.yml +++ b/TP03/ansible/roles/launch-front/tasks/main.yml @@ -4,6 +4,6 @@ docker_container: name: "{{ FRONTEND_NAME }}" image: "{{ FRONTEND_IMAGE }}" - state: started + state: absent networks: - name: "{{ NETWORK_NAME }}" \ No newline at end of file diff --git a/TP03/ansible/roles/launch-proxy/tasks/main.yml b/TP03/ansible/roles/launch-proxy/tasks/main.yml index 5db0e05..2377c6e 100644 --- a/TP03/ansible/roles/launch-proxy/tasks/main.yml +++ b/TP03/ansible/roles/launch-proxy/tasks/main.yml @@ -4,7 +4,7 @@ docker_container: name: "{{ HTTPD_NAME }}" image: "{{ HTTPD_IMAGE }}" - state: started + state: absent networks: - name: "{{ NETWORK_NAME }}" ports: diff --git a/TP03/devops-front-main/.env b/TP03/devops-front-main/.env index f61c3ae..809a87d 100755 --- a/TP03/devops-front-main/.env +++ b/TP03/devops-front-main/.env @@ -1 +1 @@ -VUE_APP_API_URL=louis.charnay.takima.cloud/api +VUE_APP_API_URL=louis.charnay.takima.cloud:80/api