Compare commits

...

3 Commits

Author SHA1 Message Date
Guillaume Emorine
5bfe7e88bc modifié : bts_annee_2/sisr2/seance_03/README.md
renommé :         bts_annee_2/sisr2/seance_03/inst-hb1.sh -> bts_annee_2/sisr2/seance_03/hb1/inst-hb1.sh
	renommé :         bts_annee_2/sisr2/seance_03/inst-hb2.sh -> bts_annee_2/sisr2/seance_03/hb2/inst-hb2.sh
	renommé :         bts_annee_2/sisr2/seance_03/Vagrantfile_bookworm -> bts_annee_2/sisr2/seance_03/vagrant/Vagrantfile_bookworm
	renommé :         bts_annee_2/sisr2/seance_03/Vagrantfile_rsync -> bts_annee_2/sisr2/seance_03/vagrant/Vagrantfile_rsync
2024-09-12 10:38:47 +02:00
Guillaume Emorine
c296e7bab9 modifié : bts_annee_2/sisr2/seance_03/README.md
nouveau fichier : bts_annee_2/sisr2/seance_03/inst-hb1.sh
	nouveau fichier : bts_annee_2/sisr2/seance_03/inst-hb2.sh
2024-09-12 10:17:14 +02:00
Guillaume Emorine
54fed5e7b5 modifié : automate.sh 2024-09-09 17:55:37 +02:00
6 changed files with 108 additions and 3 deletions

View File

@@ -27,9 +27,12 @@ if [ $branch == 1 ] ; then
echo "Commit en cours..."
sleep 1
git commit
echo "Entrez la version du tag:"
read tag
git tag $tag
echo "Push des fichiers au Gitea, branche main..."
sleep 1
git push -q origin main
git push -q origin main --tag
fi
elif [ $branch == 2 ] ; then
@@ -45,9 +48,12 @@ elif [ $branch == 2 ] ; then
echo "Commit en cours..."
sleep 1
git commit
echo "Entrez la version du tag:"
read tag
git tag $tag
echo "Push des fichiers au Gitea, branche test..."
sleep 1
git push -q origin test
git push -q origin test --tag
fi
else

View File

@@ -1 +1,2 @@
Vagrantfiles de la troisième séance en SISR.
Vagrantfiles de la troisième séance en SISR, et scripts pour le heartbeat.
Les dossiers nominaux sont les machines du heartbeat.

View File

@@ -0,0 +1,49 @@
#!/bin/bash
# les bases
# noeud hb1 : 192.168.0.101
# noeud hb2 : 192.168.0.102
# addr virt. : 192.168.0.103
sed -i 's/bookworm/hb1/g' /etc/host{s,name}
apt update
apt install -y heartbeat apache2 net-tools
systemctl disable apache2
cat <<EOT> /etc/network/interfaces.d/enp0s3
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.0.101/24 # a adapter pour hb2
EOT
cat <<EOT> /etc/network/interfaces.d/enp0s8
allow-hotplug enp0s8
iface enp0s8 inet static
address 10.0.0.1/24 # a adapter pour hb2
EOT
cd /usr/share/doc/heartbeat
gunzip *.gz
cp ha.cf /etc/ha.d
cp haresources /etc/ha.d
cp authkeys /etc/ha.d
cd /etc/ha.d
echo "192.168.0.102 hb2" >> /etc/hosts # a adapter pour hb2
cat <<EOT >> /etc/ha.d/ha.cf
bcast enp0s8
node hb1
node hb2
pacemaker off
EOT
# echo " hb1 192.168.0.103 apache2" >> /etc/ha.d/haresources pou Debian buster
echo " hb1 192.168.0.103/24/enp0s3 apache2" >> /etc/ha.d/haresources
cat <<EOT >> /etc/ha.d/authkeys
auth 1
1 crc
EOT
chmod 600 /etc/ha.d/authkeys
echo hb1 > /var/www/html/index.html # a adapter pour hb2
#

View File

@@ -0,0 +1,49 @@
#!/bin/bash
# les bases
# noeud hb1 : 192.168.0.101
# noeud hb2 : 192.168.0.102
# addr virt. : 192.168.0.103
sed -i 's/bookworm/hb2/g' /etc/host{s,name}
apt update
apt install -y heartbeat apache2 net-tools
systemctl disable apache2
cat <<EOT> /etc/network/interfaces.d/enp0s3
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.0.102/24 # a adapter pour hb2
EOT
cat <<EOT> /etc/network/interfaces.d/enp0s8
allow-hotplug enp0s8
iface enp0s8 inet static
address 10.0.0.2/24 # a adapter pour hb2
EOT
cd /usr/share/doc/heartbeat
gunzip *.gz
cp ha.cf /etc/ha.d
cp haresources /etc/ha.d
cp authkeys /etc/ha.d
cd /etc/ha.d
echo "192.168.0.101 hb1" >> /etc/hosts # a adapter pour hb2
cat <<EOT >> /etc/ha.d/ha.cf
bcast enp0s8
node hb1
node hb2
pacemaker off
EOT
# echo " hb1 192.168.0.103 apache2" >> /etc/ha.d/haresources pou Debian buster
echo " hb1 192.168.0.103/24/enp0s3 apache2" >> /etc/ha.d/haresources
cat <<EOT >> /etc/ha.d/authkeys
auth 1
1 crc
EOT
chmod 600 /etc/ha.d/authkeys
echo hb2 > /var/www/html/index.html # a adapter pour hb2
#