Compare commits
10 Commits
v0.0.2g-jl
...
v0.0.2o-jl
Author | SHA1 | Date | |
---|---|---|---|
7711d023e8 | |||
1777bec595 | |||
12621bb60a | |||
592843932c | |||
abfe277180 | |||
c2eb2b85a4 | |||
c20f44ec6e | |||
0c7d48caf3 | |||
12de1c8891 | |||
5fffbc77e2 |
49
README.md
49
README.md
@ -1,35 +1,40 @@
|
|||||||
# gsb2023
|
# gsb2023
|
||||||
|
|
||||||
2023-01-18 ps
|
2023-01-25 ps
|
||||||
|
|
||||||
Environnement et playbooks ansible pour le projet GSB 2023
|
Environnement et playbooks ansible pour le projet GSB 2023
|
||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
prérequis :
|
Prérequis :
|
||||||
* une machine Debian Bullseye
|
* une machine Debian Bullseye
|
||||||
* VirtualBox
|
* VirtualBox
|
||||||
* fichier machines viruelles ova :
|
* fichier machines viruelles **ova** :
|
||||||
* debian-bullseye-gsb-2023a.ova
|
* **debian-bullseye-gsb-2023a.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
|
* **r-int** : routage, DHCP
|
||||||
* r-int : routaage, DHCP
|
* **r-ext** : routage, NAT
|
||||||
* r-ext : routage, NAT
|
* **s-proxy** : squid
|
||||||
* s-proxy : squid
|
* **s-itil** : serveur GLPI
|
||||||
* s-itil : serveur GLPI
|
* **s-backup** : DNS esclave + sauvegarde s-win (SMB)
|
||||||
* s-backup : DNS esclave + sauvegarde s-win
|
* **s-mon** : supervision avec **Nagios4**, notifications et syslog
|
||||||
* s-mon : supervision avec **Nagios4** et syslog
|
* **s-fog** : deploiement postes de travail avec **FOG**
|
||||||
* s-fog : deploiement postes de travail avec **FOG**
|
* **s-win** : Windows Server 2019, AD, DNS, DHCP, partage fichiers
|
||||||
* s-win : Windows Server 2019, AD, DNS, DHCP, partage fichiers
|
* **s-nxc** : NextCloud avec **docker**
|
||||||
* s-nxc : NextCloud avec **docker**
|
* **s-elk** : pile ELK dockerisée
|
||||||
* s-elk : pile ELK dockerisée
|
* **s-lb** : Load Balancer **HaProxy** pour application Wordpress (DMZ)
|
||||||
* s-lb : Load Balancer **HaProxy** pour application Wordpress
|
* **r-vp1** : Routeur VPN Wireguard coté siège
|
||||||
* r-vp1 : Routeur VPN Wireguard coté siège
|
* **r-vp2** : Routeur VPN Wireguard coté agence, DHCP
|
||||||
* r-vp2 : Routeur VPN Wireguard coté agence, DHCP
|
* **s-agence** : Serveur agence
|
||||||
|
* **s-lb** : Load Balancer **HaProxy** pour application Wordpress
|
||||||
|
* **s-lb-web1** : Serveur Wordpress 1 Load Balancer
|
||||||
|
* **s-lb-web2** : Serveur Wordpress 2 Load Balancer
|
||||||
|
* **s-lb-db** : Serveur Mariadb pour Wordpress
|
||||||
|
* **s-lb-nfs** : Serveur NFS pour application Wordpress
|
||||||
|
|
||||||
|
|
||||||
## Les playbooks
|
## Les playbooks
|
||||||
@ -39,7 +44,7 @@ prérequis :
|
|||||||
|
|
||||||
On utilisera l'image de machine virtuelle suivante :
|
On utilisera l'image de machine virtuelle suivante :
|
||||||
* **debian-bullseye-2023a.ova** (2023-01-06)
|
* **debian-bullseye-2023a.ova** (2023-01-06)
|
||||||
* Debian Bullseye 11 - 2 cartes - 1 Go - stockage 20 Go
|
* Debian Bullseye 11.6 - 2 cartes - 1 Go - stockage 20 Go
|
||||||
|
|
||||||
|
|
||||||
### Machine s-adm
|
### Machine s-adm
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package:
|
package:
|
||||||
# ferm:
|
# ferm:
|
||||||
# installed: true
|
# installed: true
|
||||||
strongswan:
|
wireguard:
|
||||||
|
installed: true
|
||||||
|
wireguard-tools:
|
||||||
installed: true
|
installed: true
|
||||||
port:
|
port:
|
||||||
udp:68:
|
udp:68:
|
||||||
@ -10,7 +12,7 @@ service:
|
|||||||
# dnsmasq:
|
# dnsmasq:
|
||||||
# enabled: true
|
# enabled: true
|
||||||
# running: true
|
# running: true
|
||||||
strongswan:
|
wireguard:
|
||||||
enabled: true
|
enabled: true
|
||||||
running: true
|
running: true
|
||||||
ssh:
|
ssh:
|
||||||
@ -51,6 +53,13 @@ command:
|
|||||||
- 4 received = 1
|
- 4 received = 1
|
||||||
stderr: []
|
stderr: []
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
|
command:
|
||||||
|
ping -c 4 10.0.0.2:
|
||||||
|
exit-status: 0
|
||||||
|
stdout:
|
||||||
|
- 4 received = 1
|
||||||
|
stderr: []
|
||||||
|
timeout: 10000
|
||||||
#process:
|
#process:
|
||||||
# dnsmasq:
|
# dnsmasq:
|
||||||
# running: true
|
# running: true
|
||||||
|
@ -1,27 +1,51 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
BDIR=/home/backup
|
BDIR=/home/backup
|
||||||
SWIN=/tmp/s-win
|
SWIN=/tmp/s-win
|
||||||
|
LOCK=/tmp/s-backup.lock
|
||||||
|
|
||||||
|
#Fonction cleanup pour sortir propre dans tout les cas
|
||||||
|
cleanup()
|
||||||
|
{
|
||||||
|
rm "${LOCK}"
|
||||||
|
umount "${SWIN}"
|
||||||
|
echo "nettoyage effectue, sortie tout propre ..."
|
||||||
|
exit 3
|
||||||
|
}
|
||||||
|
|
||||||
|
#check si pas deja en cours d execution > sortie si fichier de lock existe
|
||||||
|
if [ -e "${LOCK}" ] ; then
|
||||||
|
echo "$0 : Verrouillage, deja en cours d execution"
|
||||||
|
trap cleanup 1 2 3 6
|
||||||
|
fi
|
||||||
|
#prepartion des dossiers qui vont accueillir les donnees à sauvegarder
|
||||||
[ -d "${BDIR}" ] || mkdir "${BDIR}"
|
[ -d "${BDIR}" ] || mkdir "${BDIR}"
|
||||||
[ -d "${BDIR}" ] || mkdir "${BDIR}/s-win"
|
[ -d "${BDIR}/s-win" ] || mkdir "${BDIR}/s-win"
|
||||||
[ -d "${SWIN}" ] || mkdir "${SWIN}"
|
[ -d "${SWIN}" ] || mkdir "${SWIN}"
|
||||||
|
|
||||||
mount -t cifs -o ro,vers=3.0,username=u-backup,password=Azerty1+ //s-win/commun "${SWIN}"
|
#etablissement du lock
|
||||||
|
touch "${LOCK}"
|
||||||
|
|
||||||
|
mount -t cifs -o ro,vers=3.0,username=uBackup,password=Azerty1+ //s-win/commun "${SWIN}"
|
||||||
if [ $? != 0 ] ; then
|
if [ $? != 0 ] ; then
|
||||||
echo "$0 : erreur montage ${SWIN}"
|
echo "$0 : erreur montage ${SWIN}"
|
||||||
exit 1
|
rm "${LOCK}"
|
||||||
|
trap cleanup 1 2 3 6
|
||||||
fi
|
fi
|
||||||
rsync -av "${SWIN}/" "${BDIR}/s-win/commun"
|
rsync -av "${SWIN}/" "${BDIR}/s-win/commun"
|
||||||
umount "${SWIN}"
|
umount "${SWIN}"
|
||||||
|
|
||||||
|
|
||||||
mount -t cifs -o ro,vers=3.0,username=u-backup,password=Azerty1+ //s-win/public "${SWIN}"
|
mount -t cifs -o ro,vers=3.0,username=uBackup,password=Azerty1+ //s-win/public "${SWIN}"
|
||||||
if [ $? != 0 ] ; then
|
if [ $? != 0 ] ; then
|
||||||
echo "$0 : erreur montage"
|
echo "$0 : erreur montage ${SWIN}"
|
||||||
exit 2
|
trap cleanup 1 2 3 6
|
||||||
fi
|
fi
|
||||||
rsync -av "${SWIN}/" "${BDIR}/s-win/public"
|
rsync -av "${SWIN}/" "${BDIR}/s-win/public"
|
||||||
umount "${SWIN}"
|
umount "${SWIN}"
|
||||||
|
|
||||||
|
#libere le verrou
|
||||||
|
rm "${LOCK}"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
5
roles/wireguard-l/README.md
Normal file
5
roles/wireguard-l/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#ajout du sleep 5
|
||||||
|
|
||||||
|
éditer "/etc/init.d/isc-dhcp-server"
|
||||||
|
aller au "case \"$1\" in" et rajouter "sleep 5" avant le "if"
|
||||||
|
|
@ -17,5 +17,5 @@
|
|||||||
#- name: copie du fichier de configuration depuis r-vp1
|
#- name: copie du fichier de configuration depuis r-vp1
|
||||||
# command: "sshpass -p 'root' scp -r root@192.168.99.112:/root/confwg/wg0-b.conf /etc/wireguard/"
|
# command: "sshpass -p 'root' scp -r root@192.168.99.112:/root/confwg/wg0-b.conf /etc/wireguard/"
|
||||||
|
|
||||||
- name: renommage du fichier de configuration
|
#- name: renommage du fichier de configuration
|
||||||
command: "mv /etc/wireguard/wg0-b.conf /etc/wireguard/wg0.conf"
|
# command: "mv /etc/wireguard/wg0-b.conf /etc/wireguard/wg0.conf"
|
||||||
|
@ -2,14 +2,14 @@ mkdir C:\gsb\partages
|
|||||||
|
|
||||||
cd C:\gsb\partages
|
cd C:\gsb\partages
|
||||||
|
|
||||||
mkdir compta
|
mkdir compta
|
||||||
|
|
||||||
mkdir ventes
|
mkdir ventes
|
||||||
|
|
||||||
mkdir public
|
mkdir public
|
||||||
|
|
||||||
mkdir commun
|
mkdir commun
|
||||||
|
|
||||||
mkdir users
|
cd C:\gsb
|
||||||
|
|
||||||
|
mkdir users
|
3
windows/mkusr-backup.cmd
Normal file
3
windows/mkusr-backup.cmd
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
net group gg-backup /ADD
|
||||||
|
call mkusr uBackup "u-backup" gg-backup
|
||||||
|
icacls "C:\gsb\partages\public" /Grant:r uBackup:M /T
|
@ -1,14 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo ping interface paserelle r-vp2
|
||||||
ping -c3 172.16.128.254
|
ping -c3 172.16.128.254
|
||||||
|
|
||||||
|
echo ping r-vp1 interface n-linkv
|
||||||
ping -c3 192.168.1.2
|
ping -c3 192.168.1.2
|
||||||
|
|
||||||
|
echo ping r-ext interface n-linkv
|
||||||
ping -c3 192.168.1.1
|
ping -c3 192.168.1.1
|
||||||
|
|
||||||
|
echo ping r-ext interface n-link
|
||||||
ping -c3 192.168.200.253
|
ping -c3 192.168.200.253
|
||||||
|
|
||||||
|
echo ping r-int interface n-link
|
||||||
ping -c3 192.168.200.254
|
ping -c3 192.168.200.254
|
||||||
|
|
||||||
|
echo ping r-int interface s-infra
|
||||||
ping -c3 172.16.0.254
|
ping -c3 172.16.0.254
|
||||||
|
|
||||||
|
echo ping s-infra
|
||||||
ping -c3 172.16.0.1
|
ping -c3 172.16.0.1
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo ping s-infra
|
||||||
ping -c3 172.16.0.1
|
ping -c3 172.16.0.1
|
||||||
|
|
||||||
|
echo ping r-int interface n-infra
|
||||||
ping -c3 172.16.0.254
|
ping -c3 172.16.0.254
|
||||||
|
|
||||||
|
echo ping r-int interface n-link
|
||||||
ping -c3 192.168.200.254
|
ping -c3 192.168.200.254
|
||||||
|
|
||||||
|
echo ping r-ext interface n-linkv
|
||||||
ping -c3 192.168.1.1
|
ping -c3 192.168.1.1
|
||||||
|
|
||||||
|
echo ping r-vp1 interface n-linkv
|
||||||
ping -c3 192.168.1.2
|
ping -c3 192.168.1.2
|
||||||
|
|
||||||
|
echo ping r-vp2 interface n-ag
|
||||||
ping -c3 172.16.128.254
|
ping -c3 172.16.128.254
|
||||||
|
|
||||||
|
echo ping s-agence
|
||||||
ping -c3 172.16.128.10
|
ping -c3 172.16.128.10
|
||||||
|
@ -1,12 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo ping s-infra
|
||||||
ping -c3 172.16.0.1
|
ping -c3 172.16.0.1
|
||||||
|
|
||||||
|
echo ping r-ext interface n-link
|
||||||
ping -c3 192.168.200.253
|
ping -c3 192.168.200.253
|
||||||
|
|
||||||
|
echo ping r-ext interface n-linkv
|
||||||
ping -c3 192.168.1.1
|
ping -c3 192.168.1.1
|
||||||
|
|
||||||
|
echo ping r-vp1 interface n-link
|
||||||
ping -c3 192.168.1.2
|
ping -c3 192.168.1.2
|
||||||
|
|
||||||
|
echo ping r-vp2 interface n-ag
|
||||||
ping -c3 172.16.128.254
|
ping -c3 172.16.128.254
|
||||||
|
|
||||||
|
echo ping s-agence
|
||||||
ping -c3 172.16.128.10
|
ping -c3 172.16.128.10
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo ping vers r-int
|
echo ping vers r-int
|
||||||
ping -c3 172.16.0.254 # ping r-int s-infra
|
ping -c3 172.16.0.254
|
||||||
|
|
||||||
echo ping r-int interface externe
|
echo ping r-int interface externe
|
||||||
ping -c3 192.168.200.254 # ping r-int vers r-ext
|
ping -c3 192.168.200.254
|
||||||
|
|
||||||
echo ping r-ext interface interne
|
echo ping r-ext interface interne
|
||||||
ping -c3 192.168.200.253 # ping r-ext vers
|
ping -c3 192.168.200.253
|
||||||
|
|
||||||
echo ping r-ext interface liaison
|
echo ping r-ext interface liaison
|
||||||
ping -c3 192.168.1.1
|
ping -c3 192.168.1.1
|
||||||
|
Reference in New Issue
Block a user