Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d37227592b | |||
| 472dd4feb1 | |||
| 562d1f3596 |
5
partie2/ansible/.env
Normal file
5
partie2/ansible/.env
Normal file
@@ -0,0 +1,5 @@
|
||||
GLPI_DB_HOST=db
|
||||
GLPI_DB_PORT=3306
|
||||
GLPI_DB_NAME=glpi
|
||||
GLPI_DB_USER=glpi
|
||||
GLPI_DB_PASSWORD=9Z8&i9zWUeOi
|
||||
BIN
partie2/ansible/files/SDIS29MedhiEmile-1.0-SNAPSHOT.war
Normal file
BIN
partie2/ansible/files/SDIS29MedhiEmile-1.0-SNAPSHOT.war
Normal file
Binary file not shown.
@@ -9,6 +9,7 @@ services:
|
||||
- "variables.env"
|
||||
volumes:
|
||||
- ./mariadb-java-client-3.5.6.jar:/opt/payara/glassfish/domains/domain1/lib/mariadb-java-client-3.5.6.jar:ro
|
||||
- ./SDIS29MedhiEmile-1.0-SNAPSHOT.war:/opt/payara/glassfish/domains/domain1/autodeploy/SDIS29MedhiEmile-1.0-SNAPSHOT.war
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
|
||||
33
partie2/ansible/files/docker-compose.yml
Normal file
33
partie2/ansible/files/docker-compose.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
services:
|
||||
glpi:
|
||||
image: "glpi/glpi:latest"
|
||||
restart: "unless-stopped"
|
||||
volumes:
|
||||
- "./storage/glpi:/var/glpi:rw"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
env_file: .env
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
ports:
|
||||
- "4000:80"
|
||||
|
||||
db:
|
||||
image: mariadb:latest
|
||||
restart: "unless-stopped"
|
||||
volumes:
|
||||
- ./storage/mariadb:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
|
||||
MYSQL_DATABASE: ${GLPI_DB_NAME}
|
||||
MYSQL_USER: ${GLPI_DB_USER}
|
||||
MYSQL_PASSWORD: ${GLPI_DB_PASSWORD}
|
||||
healthcheck:
|
||||
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ]
|
||||
start_period: 5s
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
expose:
|
||||
- "3306"
|
||||
2
partie2/ansible/files/http-proxy.conf
Normal file
2
partie2/ansible/files/http-proxy.conf
Normal 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"
|
||||
BIN
partie2/ansible/files/mariadb-java-client-3.5.6.jar
Normal file
BIN
partie2/ansible/files/mariadb-java-client-3.5.6.jar
Normal file
Binary file not shown.
BIN
partie2/ansible/files/sdis29.sql.gz
Normal file
BIN
partie2/ansible/files/sdis29.sql.gz
Normal file
Binary file not shown.
@@ -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
|
||||
|
||||
29
partie2/ansible/install-glpi.yml
Normal file
29
partie2/ansible/install-glpi.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Installation de GLPI avec Docker
|
||||
hosts: ap31-pt
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Création du dossier glpi
|
||||
ansible.builtin.file:
|
||||
path: /root/glpi
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Importation du fichier docker-compose.yml
|
||||
ansible.builtin.copy:
|
||||
src: ./files/docker-compose.yml
|
||||
dest: /root/glpi/docker-compose.yml
|
||||
mode: '0644'
|
||||
|
||||
- name: Importation du fichier .env
|
||||
ansible.builtin.copy:
|
||||
src: .env
|
||||
dest: /root/glpi/.env
|
||||
mode: '0600'
|
||||
|
||||
- name: Pull et lancement du conteneur GLPI
|
||||
ansible.builtin.shell:
|
||||
cmd: docker compose pull && docker compose up -d
|
||||
chdir: /root/glpi
|
||||
|
||||
62
partie2/ansible/payara.yml
Normal file
62
partie2/ansible/payara.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
- name: Installation de docker et payara dockerisé
|
||||
hosts: ap31-pt
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Téléchargement docker
|
||||
ansible.builtin.get_url:
|
||||
url: http://depl.sio.lan/store/get-docker.sh
|
||||
dest: /tmp
|
||||
|
||||
- name: Execution du script 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:
|
||||
path: ~/payara
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Importation du fichier compose.yml
|
||||
ansible.builtin.copy:
|
||||
src: ./files/compose.yml
|
||||
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: 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/ ; docker compose up -d
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
- name: playbook.yml
|
||||
hosts: ap31-test
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Téléchargement docker
|
||||
ansible.builtin.get_url:
|
||||
url: http://depl.sio.lan/store/get-docker.sh
|
||||
dest: /tmp
|
||||
|
||||
- name: Execution du script get-docker.sh
|
||||
ansible.builtin.script:
|
||||
cmd: /tmp/get-docker.sh
|
||||
|
||||
- name: Création d'un dossier payara
|
||||
ansible.builtin.file:
|
||||
path: ~/payara
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Importation du fichier payara.yml
|
||||
ansible.builtin.copy:
|
||||
src: ./files/compose.yml
|
||||
dest: ~/payara/compose.yml
|
||||
mode: '0755'
|
||||
|
||||
|
||||
- name: Docker pull
|
||||
ansible.builtin.script:
|
||||
cmd: cd ~/payara ; docker compose pull
|
||||
|
||||
Reference in New Issue
Block a user