Ajout des modifications du playbook payara et ajout de fichiers pour déploiement appli

This commit is contained in:
2025-12-04 11:53:17 +00:00
parent 4accbfc708
commit 562d1f3596
6 changed files with 39 additions and 7 deletions

View File

@@ -0,0 +1,2 @@
[Service]
Environment="HTTP_PROXY=http://10.121.38.1:8080/" "HTTPS_PROXY=http://10.121.38.1:8080/" "NO_PROXY=localhost,127.0.0.0/8"

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +1,4 @@
[ap31-srv]
ap31-test #ansible_host=172.16.0.101
ap31-pt
#ap31-test #ansible_host=172.16.0.101
#ap31-prod ansible_host=172.16.0.100

View File

@@ -1,6 +1,6 @@
---
- name: playbook.yml
hosts: ap31-test
hosts: ap31-pt
become: yes
tasks:
@@ -10,8 +10,8 @@
dest: /tmp
- name: Execution du script get-docker.sh
ansible.builtin.script:
cmd: /tmp/get-docker.sh
ansible.builtin.shell:
cmd: export https_proxy=http://10.121.38.1:8080 ; bash /tmp/get-docker.sh
- name: Création d'un dossier payara
ansible.builtin.file:
@@ -25,8 +25,37 @@
dest: ~/payara/compose.yml
mode: '0755'
- name: Création du répertoire docker.service.d
ansible.builtin.file:
path: /etc/systemd/system/docker.service.d
state: directory
mode: '0755'
- name: Docker pull
ansible.builtin.script:
cmd: cd ~/payara ; docker compose pull
- name: Importation du fichier http-proxy.conf pour docker
ansible.builtin.copy:
src: ./files/http-proxy.conf
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
mode: '0755'
- name: Importation du fichier variables.env
ansible.builtin.copy:
src: ./files/variables.env
dest: /root/payara/
mode: '0755'
- name: Importation de la base de données compréssée
ansible.builtin.copy:
src: ./files/sdis29.sql.gz
dest: /root/payara/init/
mode: '0755'
- name: Importation du fichier war
ansible.builtin.copy:
src: ./files/SDIS29MedhiEmile-1.0-SNAPSHOT.war
dest: /root/payara
- name: Docker pull et docker compose up -d
ansible.builtin.shell:
cmd: usermod -aG docker debian ; systemctl daemon-reload ; systemctl restart docker ; cd ~/payara ; docker compose pull && docker compose up -d ; docker compose down -v ; rm -rf ./data/ ; java -jar payara-micro.jar --deploy SDIS29MedhiEmile-1.0-SNAPSHOT.war ; docker compose up -d