Compare commits
No commits in common. "42b864838d7be6cd2406a3972130761813fc3b6d" and "6c7af9e808474f3c3c13fc01ddca715f23b4436c" have entirely different histories.
42b864838d
...
6c7af9e808
5
.env
5
.env
@ -8,7 +8,4 @@ KEYCLOAK_HOST_IP=172.16.32.134
|
|||||||
KEYCLOAK_HOST=connect
|
KEYCLOAK_HOST=connect
|
||||||
|
|
||||||
# Portainer
|
# Portainer
|
||||||
PORTAINER_HOST=portainer
|
PORTAINER_HOST=portainer
|
||||||
# Pour mettre a jour, encrypter le mot de passe avec la commande suivante:
|
|
||||||
# htpasswd -nb -B admin "mot_de_passe" | cut -d ":" -f 2
|
|
||||||
PORTAINER_PASSWORD=$2y$05$gMMx0FiBvYmTo68jzlD0TekI2rhQgv4O7P6XwTWNFGojyC02I4RoC
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
[defaults]
|
|
||||||
inventory = hosts
|
|
||||||
host_key_checking = False
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
[servers]
|
|
||||||
ubuntu-server-vm ansible_host=172.16.32.141 ansible_user=k
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Déploiement Docker et application via Docker Compose
|
|
||||||
hosts: servers
|
|
||||||
become: yes
|
|
||||||
vars:
|
|
||||||
git_repo: "https://gite.slm-lab.net/Chabdeltsang/Neah-Enkun.git"
|
|
||||||
git_dest: "/opt/Neah-Enkun"
|
|
||||||
git_branch: "master"
|
|
||||||
tasks:
|
|
||||||
- name: Mise à jour des paquets et montée de version
|
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
upgrade: dist
|
|
||||||
|
|
||||||
- name: Installer les dépendances pour Docker
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- apt-transport-https
|
|
||||||
- ca-certificates
|
|
||||||
- curl
|
|
||||||
- gnupg-agent
|
|
||||||
- software-properties-common
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Ajouter la clé GPG officielle de Docker
|
|
||||||
apt_key:
|
|
||||||
url: https://download.docker.com/linux/ubuntu/gpg
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Ajouter le dépôt Docker
|
|
||||||
apt_repository:
|
|
||||||
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Installer Docker CE et ses composants
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- docker-ce
|
|
||||||
- docker-ce-cli
|
|
||||||
- containerd.io
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Installer Docker Compose
|
|
||||||
apt:
|
|
||||||
name: docker-compose
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: S'assurer que le service Docker est démarré et activé
|
|
||||||
service:
|
|
||||||
name: docker
|
|
||||||
state: started
|
|
||||||
enabled: yes
|
|
||||||
|
|
||||||
- name: Cloner le dépôt Git
|
|
||||||
git:
|
|
||||||
repo: "{{ git_repo }}"
|
|
||||||
dest: "{{ git_dest }}"
|
|
||||||
version: "{{ git_branch }}"
|
|
||||||
update: yes
|
|
||||||
|
|
||||||
- name: Lancer Docker Compose up
|
|
||||||
command: "docker compose up -d --build --remove-orphans"
|
|
||||||
args:
|
|
||||||
chdir: "{{ git_dest }}"
|
|
||||||
@ -31,7 +31,6 @@ services:
|
|||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.neah-portainer.rule=Host(`${PORTAINER_HOST}.${MAIN_DOMAIN}`)"
|
- "traefik.http.routers.neah-portainer.rule=Host(`${PORTAINER_HOST}.${MAIN_DOMAIN}`)"
|
||||||
- "traefik.http.services.neah-portainer.loadbalancer.server.port=9000"
|
- "traefik.http.services.neah-portainer.loadbalancer.server.port=9000"
|
||||||
command: --admin-password='${PORTAINER_PASSWORD}'
|
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user