Compare commits
24 Commits
v0.0.1j-ps
...
v0.0.2f-jm
Author | SHA1 | Date | |
---|---|---|---|
c78e135cb6 | |||
6902c40779 | |||
1a63a0d865 | |||
975cb35f00 | |||
ccb083ddcc | |||
882a072fa9 | |||
01faab4a6e | |||
d9fb25425d | |||
fb900be1e4 | |||
92c6b3eb89 | |||
bce5723e7b | |||
a7315fa4c8 | |||
8cfbefc4dc | |||
0697ad4eec | |||
ae54eb5cb8 | |||
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
|
||||||
|
|
||||||
|
124
goss/s-adm.yaml
124
goss/s-adm.yaml
@ -1,72 +1,70 @@
|
|||||||
package:
|
package:
|
||||||
dnsmasq:
|
dnsmasq:
|
||||||
installed: true
|
installed: true
|
||||||
squid:
|
squid:
|
||||||
installed: true
|
installed: true
|
||||||
addr:
|
addr:
|
||||||
tcp://depl.sio.lan:80:
|
tcp://depl.sio.lan:80:
|
||||||
reachable: true
|
reachable: true
|
||||||
timeout: 500
|
timeout: 500
|
||||||
port:
|
port:
|
||||||
tcp:53:
|
tcp:53:
|
||||||
listening: true
|
listening: true
|
||||||
ip:
|
ip:
|
||||||
- 0.0.0.0
|
- 0.0.0.0
|
||||||
tcp6:53:
|
tcp6:53:
|
||||||
listening: true
|
listening: true
|
||||||
ip:
|
ip:
|
||||||
- '::'
|
- '::'
|
||||||
udp:53:
|
udp:53:
|
||||||
listening: true
|
listening: true
|
||||||
ip:
|
ip:
|
||||||
- 0.0.0.0
|
- 0.0.0.0
|
||||||
udp:67:
|
udp:67:
|
||||||
listening: true
|
listening: true
|
||||||
ip:
|
ip:
|
||||||
- 0.0.0.0
|
- 0.0.0.0
|
||||||
udp6:53:
|
udp6:53:
|
||||||
listening: true
|
listening: true
|
||||||
ip:
|
ip:
|
||||||
- '::'
|
- '::'
|
||||||
service:
|
service:
|
||||||
dnsmasq:
|
dnsmasq:
|
||||||
enabled: true
|
enabled: true
|
||||||
running: true
|
running: true
|
||||||
squid:
|
squid:
|
||||||
enabled: true
|
enabled: true
|
||||||
running: true
|
running: true
|
||||||
ssh:
|
ssh:
|
||||||
enabled: true
|
enabled: true
|
||||||
running: true
|
running: true
|
||||||
user:
|
user:
|
||||||
dnsmasq:
|
dnsmasq:
|
||||||
exists: true
|
exists: true
|
||||||
gid: 65534
|
gid: 65534
|
||||||
groups:
|
groups:
|
||||||
- nogroup
|
- nogroup
|
||||||
home: /var/lib/misc
|
home: /var/lib/misc
|
||||||
shell: /usr/sbin/nologin
|
shell: /usr/sbin/nologin
|
||||||
group:
|
|
||||||
ssh:
|
|
||||||
exists: true
|
|
||||||
command:
|
command:
|
||||||
/sbin/sysctl net.ipv4.ip_forward:
|
/sbin/sysctl net.ipv4.ip_forward:
|
||||||
exit-status: 0
|
exit-status: 0
|
||||||
stdout:
|
stdout:
|
||||||
- net.ipv4.ip_forward = 1
|
- net.ipv4.ip_forward = 1
|
||||||
stderr: []
|
stderr: []
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
dns:
|
dns:
|
||||||
depl.sio.lan:
|
depl.sio.lan:
|
||||||
resolveable: true
|
resolveable: true
|
||||||
timeout: 500
|
resolvable: null
|
||||||
|
timeout: 500
|
||||||
process:
|
process:
|
||||||
dnsmasq:
|
dnsmasq:
|
||||||
running: true
|
running: true
|
||||||
squid:
|
squid:
|
||||||
running: true
|
running: true
|
||||||
interface:
|
interface:
|
||||||
enp0s8:
|
enp0s8:
|
||||||
exists: true
|
exists: true
|
||||||
addrs:
|
addrs:
|
||||||
- 192.168.99.99/24
|
- 192.168.99.99/24
|
||||||
|
83
localhost,
Normal file
83
localhost,
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# Ce fichier viminfo a été généré par Vim 9.0.
|
||||||
|
# Vous pouvez l'éditer, mais soyez prudent.
|
||||||
|
|
||||||
|
# Viminfo version
|
||||||
|
|1,4
|
||||||
|
|
||||||
|
# 'encoding' dans lequel ce fichier a été écrit
|
||||||
|
*encoding=utf-8
|
||||||
|
|
||||||
|
|
||||||
|
# hlsearch on (H) or off (h):
|
||||||
|
~h
|
||||||
|
# Historique ligne de commande (chronologie décroissante) :
|
||||||
|
:q!
|
||||||
|
|2,0,1703236388,,"q!"
|
||||||
|
:x
|
||||||
|
|2,0,1703236381,,"x"
|
||||||
|
:x!
|
||||||
|
|2,0,1703236221,,"x!"
|
||||||
|
|
||||||
|
# Historique chaîne de recherche (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Historique expression (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Historique ligne de saisie (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Historique Ligne de débogage (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Registres :
|
||||||
|
""1 LINE 0
|
||||||
|
connection: local
|
||||||
|
|3,1,1,1,1,0,1703236374," connection: local"
|
||||||
|
"2 LINE 0
|
||||||
|
hosts: localhost
|
||||||
|
|3,0,2,1,1,0,1703236374," hosts: localhost"
|
||||||
|
|
||||||
|
# Marques dans le fichier :
|
||||||
|
'0 1 2 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,48,1,2,1703236388,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'1 1 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,49,1,9,1703236339,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'2 9 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,50,9,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'3 9 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,51,9,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'4 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,52,11,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'5 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,53,11,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'6 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,54,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'7 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,55,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'8 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,56,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'9 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,57,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
|
||||||
|
# Liste de sauts (le plus récent en premier) :
|
||||||
|
-' 1 2 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,2,1703236388,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 1 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,9,1703236339,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 9 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,9,9,1703236318,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,11,9,1703236318,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,11,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,13,1703236018,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
|
||||||
|
# Historique des marques dans les fichiers (les plus récentes en premier) :
|
||||||
|
|
||||||
|
> ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
* 1703236386 0
|
||||||
|
" 1 2
|
||||||
|
^ 9 10
|
||||||
|
. 2 0
|
||||||
|
+ 10 0
|
||||||
|
+ 2 0
|
@ -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
|
||||||
|
@ -74,3 +74,9 @@
|
|||||||
- net.ipv6.conf.all.disable_ipv6
|
- net.ipv6.conf.all.disable_ipv6
|
||||||
- net.ipv6.conf.default.disable_ipv6
|
- net.ipv6.conf.default.disable_ipv6
|
||||||
- net.ipv6.conf.lo.disable_ipv6
|
- net.ipv6.conf.lo.disable_ipv6
|
||||||
|
|
||||||
|
- name: desactive unatentted upgrade
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: unattended-upgrades.service
|
||||||
|
state: stopped
|
||||||
|
enabled: false
|
||||||
|
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,6 +1,15 @@
|
|||||||
|
#variable depl
|
||||||
depl_url: "http://s-adm.gsb.adm/gsbstore"
|
depl_url: "http://s-adm.gsb.adm/gsbstore"
|
||||||
#depl_glpi: "glpi-9.5.6.tgz"
|
#depl_glpi: "glpi-9.5.6.tgz"
|
||||||
depl_glpi: "glpi-10.0.6.tgz"
|
depl_glpi: "glpi-10.0.11.tgz"
|
||||||
#depl_fusioninventory: "fusioninventory-9.5+3.0.tar.bz2"
|
#depl_fusioninventory: "fusioninventory-9.5+3.0.tar.bz2"
|
||||||
depl_glpi_agentx64: "GLPI-Agent-1.4-x64.msi"
|
depl_glpi_agentx64: "GLPI-Agent-1.7-x64.msi"
|
||||||
depl_glpi_agentx86: "GLPI-Agent-1.4-x86.msi"
|
|
||||||
|
#variables glpi
|
||||||
|
glpi_version: "10.0.11"
|
||||||
|
glpi_dir: "/var/www/html/glpi"
|
||||||
|
glpi_dbhost: "127.0.0.1"
|
||||||
|
glpi_dbname: "glpi"
|
||||||
|
glpi_dbuser: "glpi"
|
||||||
|
glpi_dbpasswd: "glpi"
|
||||||
|
glpi_cli: "/var/www/html/glpicli"
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
chm="/var/www/html/glpi/files/_dumps"
|
|
||||||
# Dump base GLPI
|
|
||||||
mysqldump -uroot -proot glpi |gzip > $chm/$(date +%Y-%m-%d).sql.gz
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: restart php-fpm
|
- name: restart php-fpm
|
||||||
service: name=php7.0-fpm state=restarted
|
service: name=php8.2-fpm state=restarted
|
||||||
|
|
||||||
- name: restart nginx
|
- name: restart nginx
|
||||||
service: name=nginx state=restarted
|
service: name=nginx state=restarted
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Installation des paquets
|
- name: Installation des paquets
|
||||||
apt:
|
apt:
|
||||||
state: latest
|
state: present
|
||||||
name:
|
name:
|
||||||
- nginx
|
- nginx
|
||||||
- php-fpm
|
- php-fpm
|
||||||
@ -24,10 +24,10 @@
|
|||||||
- postfix
|
- postfix
|
||||||
- mailutils
|
- mailutils
|
||||||
|
|
||||||
- name: Changement listen dans le fichier conf de php7.3
|
- name: Changement listen dans le fichier conf de php8.2
|
||||||
replace:
|
replace:
|
||||||
dest: /etc/php/7.4/fpm/pool.d/www.conf
|
dest: /etc/php/8.2/fpm/pool.d/www.conf
|
||||||
regexp: 'listen = /run/php/php7.4-fpm.sock'
|
regexp: 'listen = /run/php/php8.2-fpm.sock'
|
||||||
replace: 'listen = 127.0.0.1:9000'
|
replace: 'listen = 127.0.0.1:9000'
|
||||||
backup: yes
|
backup: yes
|
||||||
|
|
||||||
@ -41,9 +41,12 @@
|
|||||||
src: block.j2
|
src: block.j2
|
||||||
dest: /etc/nginx/sites-enabled/glpi
|
dest: /etc/nginx/sites-enabled/glpi
|
||||||
|
|
||||||
|
notify:
|
||||||
|
- restart nginx
|
||||||
|
|
||||||
- name: Remplacement dans le fichier de conf php du timeout
|
- name: Remplacement dans le fichier de conf php du timeout
|
||||||
replace:
|
replace:
|
||||||
dest: /etc/php/7.4/fpm/php.ini
|
dest: /etc/php/8.2/fpm/php.ini
|
||||||
regexp: 'max_execution_time = 30'
|
regexp: 'max_execution_time = 30'
|
||||||
replace: 'max_execution_time = 600'
|
replace: 'max_execution_time = 600'
|
||||||
backup: yes
|
backup: yes
|
||||||
@ -112,9 +115,9 @@
|
|||||||
# dest: /var/www/html/glpi/plugins
|
# dest: /var/www/html/glpi/plugins
|
||||||
# remote_src: yes
|
# remote_src: yes
|
||||||
|
|
||||||
- name: Creation de ficlient
|
- name: Creation de glpicli
|
||||||
file:
|
file:
|
||||||
path: /var/www/html/ficlients
|
path: "{{ glpi_cli }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: www-data
|
owner: www-data
|
||||||
group: www-data
|
group: www-data
|
||||||
@ -130,21 +133,19 @@
|
|||||||
- name: Installation de GLPI Agent windows x64
|
- name: Installation de GLPI Agent windows x64
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ depl_url }}/{{ depl_glpi_agentx64 }}"
|
url: "{{ depl_url }}/{{ depl_glpi_agentx64 }}"
|
||||||
dest: "/var/www/html/ficlients"
|
dest: "{{ glpi_cli }}"
|
||||||
|
|
||||||
# - name: Installation de GLPI Agent windows x86
|
notify:
|
||||||
# get_url:
|
- restart nginx
|
||||||
# url: "{{ depl_url }}/{{ depl_glpi_agentx86 }}"
|
|
||||||
# dest: "/var/www/html/ficlients"
|
|
||||||
|
|
||||||
- name: Copie du script dbdump
|
- name: lancer la commande de création de la base de donnees glpi
|
||||||
copy:
|
ansible.builtin.shell: php bin/console database:install -f -n
|
||||||
src: dbdump
|
args:
|
||||||
dest: /root/
|
chdir: "{{ glpi_dir }}"
|
||||||
|
|
||||||
- name: chmod de dbdump
|
|
||||||
shell: chmod +x /root/dbdump
|
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "base de donnees de glpi creer"
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "Redemarrez le serveur GLPI"
|
msg: "Redemarrez le serveur GLPI"
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ server {
|
|||||||
fastcgi_param SERVER_NAME $host;
|
fastcgi_param SERVER_NAME $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /ficlients {
|
location /glpicli {
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
autoindex on;
|
autoindex on;
|
||||||
}
|
}
|
||||||
|
16
roles/journald-rcv/README.md
Normal file
16
roles/journald-rcv/README.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Role syslog : installation et configuration de syslog serveur (centralisation des logs)
|
||||||
|
***
|
||||||
|
|
||||||
|
Ce role a pour objectif de activer le module UDP dans le fichier /etc/rsyslog.conf pour accepter les logs entrants des machines concernées :
|
||||||
|
on décommente la ligne suivante :
|
||||||
|
'module(load="imudp"\)'
|
||||||
|
|
||||||
|
Ensuite le role active l'écoute du module UDP sur le port 514 afin de pouvoir envoyer les logs.
|
||||||
|
on décommente la ligne suivante dans le même fichier que ci-dessus :
|
||||||
|
'input\(type="imudp" port="514"\)'
|
||||||
|
|
||||||
|
pour finir le role va charger le module UDP afin que la machine **s-infra** puissent reçevoir les logs entrants.
|
||||||
|
Pour faire cela on décommente la ligne suivante dans le fichier /etc/systemd/journald.conf :
|
||||||
|
'ForwardToSyslog=yes'
|
||||||
|
|
||||||
|
pour finir le role va redemmarer automatiquement les services journald et rsyslog
|
5
roles/journald-rcv/handlers/main.yml
Normal file
5
roles/journald-rcv/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: restart journald
|
||||||
|
service:
|
||||||
|
name: systemd-journald.service
|
||||||
|
state: restarted
|
44
roles/journald-rcv/tasks/main.yml
Normal file
44
roles/journald-rcv/tasks/main.yml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
- name: 1. Installation de systemd-journal-remote
|
||||||
|
apt:
|
||||||
|
name: systemd-journal-remote
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: 2. Enable et start systemd-journal-remote.socket
|
||||||
|
systemd:
|
||||||
|
name: systemd-journal-remote.socket
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
|
||||||
|
- name: 3. Copie de systemd-journal-remote.service dans /etc/systemd/system
|
||||||
|
copy:
|
||||||
|
src: /lib/systemd/system/systemd-journal-remote.service
|
||||||
|
dest: /etc/systemd/system/systemd-journal-remote.service
|
||||||
|
remote_src: yes
|
||||||
|
backup: yes
|
||||||
|
|
||||||
|
|
||||||
|
- name: 4. Modification de systemd-journal-remote.service
|
||||||
|
replace:
|
||||||
|
path: /etc/systemd/system/systemd-journal-remote.service
|
||||||
|
regexp: '--listen-https=-3'
|
||||||
|
replace: '--listen-http=-3'
|
||||||
|
|
||||||
|
- name: 5. active le mode SplitMode en mode Host
|
||||||
|
replace:
|
||||||
|
path: /etc/systemd/journal-remote.conf
|
||||||
|
regexp: '^#\sSplitMode=host'
|
||||||
|
replace: 'SplitMode=host'
|
||||||
|
|
||||||
|
|
||||||
|
- name: 6. Creation /var/log/journal/remote directory
|
||||||
|
file:
|
||||||
|
path: /var/log/journal/remote
|
||||||
|
state: directory
|
||||||
|
owner: systemd-journal-remote
|
||||||
|
|
||||||
|
- name: 7. Redemarrage de systemd
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
# notify:
|
||||||
|
#- restart journald
|
16
roles/journald-snd/README.md
Normal file
16
roles/journald-snd/README.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Role syslog : installation et configuration de syslog serveur (centralisation des logs)
|
||||||
|
***
|
||||||
|
|
||||||
|
Ce role a pour objectif de activer le module UDP dans le fichier /etc/rsyslog.conf pour accepter les logs entrants des machines concernées :
|
||||||
|
on décommente la ligne suivante :
|
||||||
|
'module(load="imudp"\)'
|
||||||
|
|
||||||
|
Ensuite le role active l'écoute du module UDP sur le port 514 afin de pouvoir envoyer les logs.
|
||||||
|
on décommente la ligne suivante dans le même fichier que ci-dessus :
|
||||||
|
'input\(type="imudp" port="514"\)'
|
||||||
|
|
||||||
|
pour finir le role va charger le module UDP afin que la machine **s-infra** puissent reçevoir les logs entrants.
|
||||||
|
Pour faire cela on décommente la ligne suivante dans le fichier /etc/systemd/journald.conf :
|
||||||
|
'ForwardToSyslog=yes'
|
||||||
|
|
||||||
|
pour finir le role va redemmarer automatiquement les services journald et rsyslog
|
10
roles/journald-snd/handlers/main.yml
Normal file
10
roles/journald-snd/handlers/main.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- name: enable systemd-journal-upload
|
||||||
|
service:
|
||||||
|
name: systemd-journal-upload.service
|
||||||
|
state: enabled
|
||||||
|
|
||||||
|
- name: restart systemd-journal-upload
|
||||||
|
service:
|
||||||
|
name: systemd-journal-upload.service
|
||||||
|
state: restarted
|
31
roles/journald-snd/tasks/main.yml
Normal file
31
roles/journald-snd/tasks/main.yml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
- name: 1. installe systemd-journal-remote
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- systemd-journal-remote
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: 2. indique l'URL journald distant
|
||||||
|
replace:
|
||||||
|
path: /etc/systemd/journal-upload.conf
|
||||||
|
regexp: '^#\sURL='
|
||||||
|
replace: 'URL=http://syslog.gsb.adm:19532'
|
||||||
|
|
||||||
|
- name: 3. Just force systemd to reread configs (2.4 and above)
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
|
- name: 4. active le service systemd-journald-upload
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: systemd-journal-upload.service
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
|
- name: 5. redemarre systemd-journal-upload.service
|
||||||
|
service:
|
||||||
|
name: systemd-journal-upload.service
|
||||||
|
state: restarted
|
||||||
|
#notify:
|
||||||
|
#- enable systemd-journal-upload
|
||||||
|
#- restart systemd-journal-upload
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
BEATVER: "8.5.3"
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user