Compare commits
9 Commits
v0.0.1j-ps
...
v0.0.1q-ps
Author | SHA1 | Date | |
---|---|---|---|
2fe557e70b | |||
877f0a054f | |||
74433d2655 | |||
51ac36f669 | |||
3f565e0dac | |||
71d35bb498 | |||
78da7eef67 | |||
ed512fc702 | |||
17266a2b57 |
43
README.md
43
README.md
@ -1,18 +1,22 @@
|
|||||||
# gsb2024
|
# gsb2024
|
||||||
|
|
||||||
2024-12-19 ps
|
2024-12-21 ps
|
||||||
|
|
||||||
Environnement et playbooks ansible pour le projet GSB 2024
|
Environnement et playbooks ansible pour le projet GSB 2024
|
||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
|
||||||
Prérequis :
|
Prérequis :
|
||||||
* une machine Debian Bookworm
|
* une machine LInux Debian Bookworm ou Windows
|
||||||
* VirtualBox
|
* VirtualBox
|
||||||
|
* git
|
||||||
* fichier machines virtuelles **ova** :
|
* fichier machines virtuelles **ova** :
|
||||||
* **debian-bookworm-gsb-2023c.ova**
|
* **debian-bookworm-gsb-2023c.ova**
|
||||||
* **debian-buster-gsb-2023a.ova**
|
* **debian-buster-gsb-2023a.ova**
|
||||||
|
|
||||||
|
|
||||||
|
## Les machines
|
||||||
|
|
||||||
* **s-adm** : routeur adm, DHCP + NAT, deploiement, proxy squid
|
* **s-adm** : routeur adm, DHCP + NAT, deploiement, proxy squid
|
||||||
* **s-infra** : DNS maitre, autoconfiguration navigateurs avec **wpad**
|
* **s-infra** : DNS maitre, autoconfiguration navigateurs avec **wpad**
|
||||||
* **r-int** : routage, DHCP
|
* **r-int** : routage, DHCP
|
||||||
@ -38,6 +42,7 @@ Prérequis :
|
|||||||
|
|
||||||
## Les playbooks
|
## Les playbooks
|
||||||
|
|
||||||
|
Il existe un playbook ansible pour chaque machine à installer, nommé comme la machine avec l'extension **.yml**
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -49,25 +54,26 @@ et pour **s-fog** :
|
|||||||
* **debian-buster-2023a.ova** (2023-01-06)
|
* **debian-buster-2023a.ova** (2023-01-06)
|
||||||
* Debian Buster 10 - 2 cartes - 1 Go - stockage 20 Go
|
* Debian Buster 10 - 2 cartes - 1 Go - stockage 20 Go
|
||||||
|
|
||||||
|
Les images **.ova** doivent etre stockées dans le répertoire habituel de téléchargement de l'utilisateur courant.
|
||||||
|
|
||||||
### Création d'une VM
|
### Création d'une VM
|
||||||
|
|
||||||
Récupérer le dépot gsb2024.git avec :
|
Sur la machine physique, récupérer le dépot **gsb2024.git** avec :
|
||||||
```shell
|
```shell
|
||||||
git clone https://gitea.lyc-lecastel.fr/gsb/gsb2024.git
|
git clone https://gitea.lyc-lecastel.fr/gsb/gsb2024.git
|
||||||
cd gsb2024
|
|
||||||
```
|
```
|
||||||
|
|
||||||
On utilisera le script (bash) **mkvm** ou (PowerShell) **mkvm.ps1** pour créer une VM Virtualbox.
|
On utilisera le script (bash) **mkvm** ou (PowerShell) **mkvm.ps1** pour créer une VM Virtualbox.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
gsb2024>
|
cd gsb2024/scripts
|
||||||
cd scripts
|
mkvm -r s-adm
|
||||||
$ mkvm -r s-adm
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Machine s-adm
|
### Machine s-adm
|
||||||
* créer la machine virtuelle **s-adm** avec **mkvm** comme décrit plus haut.
|
* créer la machine virtuelle **s-adm** avec **mkvm** comme décrit plus haut.
|
||||||
|
* démarrer la VM puis ouvir une session
|
||||||
* utiliser le script de renommage comme suit :
|
* utiliser le script de renommage comme suit :
|
||||||
```shell
|
```shell
|
||||||
bash chname <nouveau_nom_de_machine>` , puis redémarrer
|
bash chname <nouveau_nom_de_machine>` , puis redémarrer
|
||||||
@ -89,20 +95,35 @@ bash chname <nouveau_nom_de_machine>` , puis redémarrer
|
|||||||
|
|
||||||
### Pour chaque machine
|
### Pour chaque machine
|
||||||
|
|
||||||
|
#### Etape 1
|
||||||
|
|
||||||
- créer la machine avec **mkvm -r**, les cartes réseau sont paramétrées par **mkvm** selon les spécifications
|
- créer la machine avec **mkvm -r**, les cartes réseau sont paramétrées par **mkvm** selon les spécifications
|
||||||
- utiliser le script de renommage comme suit : `bash chname <nouveau_nom_de_machine>`
|
- ouvrir une session sur la machine considérée
|
||||||
- redémarrer
|
- renomme la machine soit
|
||||||
|
* en utilisant le script de renommage comme suit :
|
||||||
|
` /root/tools/ansible/gsb2024/scripts/chname <nouveau_nom_de_machine>`
|
||||||
|
* soit avec :
|
||||||
|
```shell
|
||||||
|
NHOST=mavm
|
||||||
|
sed -i "s/bookworm/${NHOST}/g" /etc/host{s,name}
|
||||||
|
sudo reboot # on redemarre
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Etape 2
|
||||||
|
|
||||||
- utiliser le script **gsb-start** : `bash gsb-start`
|
- utiliser le script **gsb-start** : `bash gsb-start`
|
||||||
- ou sinon:
|
- ou sinon:
|
||||||
```shell
|
```shell
|
||||||
mkdir -p tools/ansible ; cd tools/ansible
|
mkdir -p tools/ansible ; cd tools/ansible
|
||||||
git clone https://gitea.lyc-lecastel.fr/gsb/gsb2024.git
|
git clone https://gitea.lyc-lecastel.fr/gsb/gsb2024.git
|
||||||
cd gsb2024/pre
|
cd gsb2024/pre
|
||||||
export DEPL=192.168.99.99
|
DEPL=192.168.99.99 bash gsbboot
|
||||||
bash gsbboot
|
|
||||||
cd ../..
|
cd ../..
|
||||||
bash pull-config
|
bash pull-config
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Etape 3
|
||||||
|
|
||||||
- redémarrer
|
- redémarrer
|
||||||
- **Remarque** : une machine doit avoir été redémarrée pour prendre en charge la nouvelle configuration
|
- **Remarque** : une machine doit avoir été redémarrée pour prendre en charge la nouvelle configuration
|
||||||
|
|
||||||
|
@ -11,50 +11,36 @@ apt-get update
|
|||||||
apt-get install -y apache2 git
|
apt-get install -y apache2 git
|
||||||
STOREREP="/var/www/html/gsbstore"
|
STOREREP="/var/www/html/gsbstore"
|
||||||
|
|
||||||
GLPIREL=10.0.6
|
GLPIREL=10.0.11
|
||||||
str="wget -nc https://github.com/glpi-project/glpi/releases/download/${GLPIREL}/glpi-${GLPIREL}.tgz"
|
str="wget -nc https://github.com/glpi-project/glpi/releases/download/${GLPIREL}/glpi-${GLPIREL}.tgz"
|
||||||
|
|
||||||
|
|
||||||
#Fusion Inventory
|
|
||||||
|
|
||||||
#FIREL=10.0.3+1.0
|
|
||||||
#str2="https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi${FIREL}/fusioninventory-${FIREL}.tar.bz2"
|
|
||||||
|
|
||||||
|
|
||||||
#GLPI Agent
|
#GLPI Agent
|
||||||
|
|
||||||
GLPIAGVER=1.4
|
GLPIAGVER=1.7
|
||||||
str31="wget -nc https://github.com/glpi-project/glpi-agent/releases/download/${GLPIAGVER}/GLPI-Agent-${GLPIAGVER}-x64.msi"
|
str31="wget -nc https://github.com/glpi-project/glpi-agent/releases/download/${GLPIAGVER}/GLPI-Agent-${GLPIAGVER}-x64.msi"
|
||||||
|
|
||||||
str32="wget -nc https://github.com/glpi-project/glpi-agent/releases/download/${GLPIAGVER}/GLPI-Agent-${GLPIAGVER}-x86.msi"
|
#str32="wget -nc https://github.com/glpi-project/glpi-agent/releases/download/${GLPIAGVER}/GLPI-Agent-${GLPIAGVER}-x86.msi"
|
||||||
|
|
||||||
|
FOGREL=1.5.10
|
||||||
FOGREL=1.5.9
|
|
||||||
str4="wget -nc https://github.com/FOGProject/fogproject/archive/${FOGREL}.tar.gz -O fogproject-${FOGREL}.tar.gz"
|
str4="wget -nc https://github.com/FOGProject/fogproject/archive/${FOGREL}.tar.gz -O fogproject-${FOGREL}.tar.gz"
|
||||||
|
|
||||||
WPREL=6.1.1
|
WPREL=6.4.2
|
||||||
#v6.1.1 le 17/01/2023
|
#v6.1.1 le 17/01/2023
|
||||||
str5="wget -nc https://fr.wordpress.org/latest-fr_FR.tar.gz -O wordpress-6.1.1-fr_FR.tar.gz"
|
str5="wget -nc https://fr.wordpress.org/latest-fr_FR.tar.gz -O wordpress-6.4.2-fr_FR.tar.gz"
|
||||||
|
|
||||||
GOSSVER=v0.3.21
|
str6="curl -L https://github.com/goss-org/goss/releases/latest/download/goss-linux-amd64 -o goss"
|
||||||
str6="curl -L https://github.com/aelsabbahy/goss/releases/download/${GOSSVER}/goss-linux-amd64 -o goss"
|
|
||||||
|
|
||||||
#DOCKERREL=1.29.2
|
str7="curl -L https://github.com/goss-org/goss/releases/latest/download/dgoss -o dgoss"
|
||||||
#str7="curl -L https://github.com/docker/compose/releases/download/${DOCKERREL}/docker-compose-$(uname -s)-$(uname -m) -o docker-compose"
|
|
||||||
|
|
||||||
#GESTSUPREL=3.2.30
|
#GESTSUPREL=3.2.30
|
||||||
#str8="wget -nc 'https://gestsup.fr/index.php?page=download&channel=stable&version=${GESTSUPREL}&type=gestsup' -O gestsup_${GESTSUPREL}.zip"
|
#str8="wget -nc 'https://gestsup.fr/index.php?page=download&channel=stable&version=${GESTSUPREL}&type=gestsup' -O gestsup_${GESTSUPREL}.zip"
|
||||||
str8="wget -nc 'https://gestsup.fr/index.php?page=download&channel=stable&version=3.2.30&type=gestsup' -O gestsup_3.2.30.zip"
|
str8="wget -nc 'https://gestsup.fr/index.php?page=download&channel=stable&version=3.2.30&type=gestsup' -O gestsup_3.2.30.zip"
|
||||||
|
|
||||||
|
|
||||||
#METRICBEAT ET FILEBEAT
|
#METRICBEAT ET FILEBEAT
|
||||||
ELKREL=8.5.3
|
ELKREL=8.11.3
|
||||||
str81="wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${ELKREL}-amd64.deb"
|
str81="wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${ELKREL}-amd64.deb"
|
||||||
|
|
||||||
str82="wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${ELKREL}-windows-x86_64.zip"
|
str82="wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${ELKREL}-windows-x86_64.zip"
|
||||||
|
|
||||||
str83="wget https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-${ELKREL}-windows-x86_64.zip"
|
str83="wget https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-${ELKREL}-windows-x86_64.zip"
|
||||||
|
|
||||||
str84="wget https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-${ELKREL}-amd64.deb"
|
str84="wget https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-${ELKREL}-amd64.deb"
|
||||||
|
|
||||||
|
|
||||||
@ -64,32 +50,18 @@ str84="wget https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-$
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
${str}
|
${str}
|
||||||
|
|
||||||
${str2}
|
|
||||||
|
|
||||||
${str31}
|
${str31}
|
||||||
|
|
||||||
${str32}
|
|
||||||
|
|
||||||
${str4}
|
${str4}
|
||||||
|
|
||||||
${str5}
|
${str5}
|
||||||
|
|
||||||
${str6}
|
${str6}
|
||||||
|
${str7}
|
||||||
|
|
||||||
chmod +x ./goss
|
chmod +x ./goss ./dgoss
|
||||||
|
|
||||||
curl -L https://get.docker.com -o getdocker.sh
|
curl -L https://get.docker.com -o getdocker.sh
|
||||||
|
|
||||||
chmod +x ./getdocker.sh
|
chmod +x ./getdocker.sh
|
||||||
|
|
||||||
#${str7}
|
|
||||||
|
|
||||||
#chmod +x ./docker-compose
|
|
||||||
|
|
||||||
|
|
||||||
wget -nc https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64 -O mkcert
|
wget -nc https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64 -O mkcert
|
||||||
|
|
||||||
chmod +x ./mkcert
|
chmod +x ./mkcert
|
||||||
|
|
||||||
${str8}
|
${str8}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
dir=/root/tools/ansible
|
dir=/root/tools/ansible
|
||||||
prj=gsb2023
|
prj=gsb2024
|
||||||
opt=""
|
opt=""
|
||||||
|
|
||||||
if [ -z ${UREP+x} ]; then
|
if [ -z ${UREP+x} ]; then
|
||||||
UREP=https://gitea.lyc-lecastel.fr/gadmin/gsb2023.git
|
UREP=https://gitea.lyc-lecastel.fr/gsb/gsb2024.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dir=/root/tools/ansible
|
dir=/root/tools/ansible
|
||||||
|
8
roles/elk-filebeat-cli/README.md
Normal file
8
roles/elk-filebeat-cli/README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Rôle elk-filebeat-cli
|
||||||
|
## Présentation
|
||||||
|
|
||||||
|
**Filebeat** permet d'envoyer les logs système à un serveur **ELK**.
|
||||||
|
Ce rôle :
|
||||||
|
* insatlle le paquet **filebeat**
|
||||||
|
* configure **filebeat** (fichier /etc/filebeat/filebeat.yml)
|
||||||
|
* active le module **system** (Logs système)
|
1
roles/elk-filebeat-cli/defaults/main.yml
Normal file
1
roles/elk-filebeat-cli/defaults/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
BEATVER: "8.11.5"
|
@ -1,6 +1,7 @@
|
|||||||
## Utilisation du rôle metricbeat-cli
|
# Rôle elk-metricbeat-cli
|
||||||
|
## Utilisation
|
||||||
|
|
||||||
Ce rôle permet d'installer l'agent metricbeat pour le serveur ELK.
|
Ce rôle permet d'installer l'agent **metricbeat** pour le serveur ELK.
|
||||||
Metricbeat sert à faire des statistiques de performances sur les différents serveurs.
|
Metricbeat sert à faire des statistiques de performances sur les différents serveurs.
|
||||||
Ce rôle fonctionne en faisant :
|
Ce rôle fonctionne en faisant :
|
||||||
Une installation de metricbeat,
|
Une installation de metricbeat,
|
1
roles/elk-metricbeat-cli/defaults/main.yml
Normal file
1
roles/elk-metricbeat-cli/defaults/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
BEATVER: "8.11.5"
|
@ -1,7 +0,0 @@
|
|||||||
## Explication du rôle filebeat-cli
|
|
||||||
|
|
||||||
Filebeat permet de centraliser et simplifier la gestion de logs pour ELK.
|
|
||||||
Ce rôle fonctionne en faisant :
|
|
||||||
Une installation de filebeat
|
|
||||||
Une configuration de filebeat
|
|
||||||
Une activation du module system(Logs système)
|
|
@ -1 +0,0 @@
|
|||||||
BEATVER: "8.5.3"
|
|
@ -1 +0,0 @@
|
|||||||
BEATVER: "8.5.3"
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
mkvmrelease="v1.2.3"
|
mkvmrelease="v1.3.0"
|
||||||
|
|
||||||
ovarelease="2023c"
|
ovarelease="2023c"
|
||||||
ovafogrelease="2023b"
|
ovafogrelease="2023b"
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#mkvm pour toutes les vms
|
#mkvm pour toutes les vms
|
||||||
|
|
||||||
$mkvmrelease="v1.2.2"
|
$mkvmrelease="v1.3.0"
|
||||||
$ovarelease="2023b"
|
$ovarelease="2023c"
|
||||||
$ovafogrelease="2023b"
|
$ovafogrelease="2023b"
|
||||||
$ovafile="$HOME\Downloads\debian-bullseye-gsb-${ovarelease}.ova"
|
$ovafile="$HOME\Downloads\debian-bookworm-gsb-${ovarelease}.ova"
|
||||||
$ovafilefog="$HOME\Downloads\debian-buster-gsb-${ovafogrelease}.ova"
|
$ovafilefog="$HOME\Downloads\debian-buster-gsb-${ovafogrelease}.ova"
|
||||||
$vboxmanage="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
|
$vboxmanage="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
|
||||||
$deletemode=0
|
$deletemode=0
|
||||||
|
Reference in New Issue
Block a user