Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4accbfc708 | |||
| a01b1eb764 | |||
| d7d3ee014a |
0
partie2/README.md
Normal file
0
partie2/README.md
Normal file
25
partie2/ansible/files/compose.yml
Normal file
25
partie2/ansible/files/compose.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
services:
|
||||||
|
payara:
|
||||||
|
image: payara/server-full:6.2025.9-jdk17
|
||||||
|
container_name: payara
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
- "4848:4848"
|
||||||
|
env_file:
|
||||||
|
- "variables.env"
|
||||||
|
volumes:
|
||||||
|
- ./mariadb-java-client-3.5.6.jar:/opt/payara/glassfish/domains/domain1/lib/mariadb-java-client-3.5.6.jar:ro
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mariadb:latest
|
||||||
|
container_name: db
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
env_file:
|
||||||
|
- "variables.env"
|
||||||
|
volumes:
|
||||||
|
- ./data/db_data:/var/lib/mysql
|
||||||
|
- ./init:/docker-entrypoint-initdb.d
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
7
partie2/ansible/files/variables.env
Normal file
7
partie2/ansible/files/variables.env
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
MYSQL_DATABASE=sdis29
|
||||||
|
MYSQL_HOST=db
|
||||||
|
MYSQL_PORT=3306
|
||||||
|
MYSQL_USER=adminBDsdis
|
||||||
|
MYSQL_PASSWORD=u@4xKH@X
|
||||||
|
MYSQL_ROOT_PASSWORD=2Fc#$9Fn
|
||||||
|
|
||||||
3
partie2/ansible/hosts
Normal file
3
partie2/ansible/hosts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[ap31-srv]
|
||||||
|
ap31-test #ansible_host=172.16.0.101
|
||||||
|
#ap31-prod ansible_host=172.16.0.100
|
||||||
32
partie2/ansible/playbook.yml
Normal file
32
partie2/ansible/playbook.yml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- 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
|
||||||
|
|
||||||
0
partie2/test
Normal file
0
partie2/test
Normal file
Reference in New Issue
Block a user