From 203c8e01631e95eebfd92b570d1b01865a9aa5dd Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 21 Nov 2023 13:19:03 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20des=20licences=20ad=C3=A9quates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blockcommit_all.sh | 16 ++++++++++++++++ execute_cmd_all.sh | 18 ++++++++++++++++++ execute_script_all.sh | 17 +++++++++++++++++ migrate_many_to_aunt.sh | 17 +++++++++++++++++ migrate_many_to_mother.sh | 17 +++++++++++++++++ migrate_to_aunt.sh | 17 +++++++++++++++++ migrate_to_britt_p2p.sh | 17 +++++++++++++++++ migrate_to_mother.sh | 17 +++++++++++++++++ migrate_to_mother_p2p.sh | 17 +++++++++++++++++ old_restore.sh | 17 +++++++++++++++++ restore.sh | 16 ++++++++++++++++ split-brain_resolve.sh | 17 +++++++++++++++++ start_all.sh | 17 +++++++++++++++++ supervision.sh | 17 +++++++++++++++++ 14 files changed, 237 insertions(+) diff --git a/blockcommit_all.sh b/blockcommit_all.sh index 3b17a9b..11a8c68 100755 --- a/blockcommit_all.sh +++ b/blockcommit_all.sh @@ -1,4 +1,20 @@ #!/bin/bash +# Script to commit blocks of vm disks +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . count=$1 VMs=$(sudo virsh list --state-running --name | sort -R) diff --git a/execute_cmd_all.sh b/execute_cmd_all.sh index c908ddb..a23678c 100755 --- a/execute_cmd_all.sh +++ b/execute_cmd_all.sh @@ -1,4 +1,22 @@ #!/bin/bash +# Script to execute a single command to multiple machines +# via ssh +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + command=$1 VMs=$(sudo virsh list --state-running --name) diff --git a/execute_script_all.sh b/execute_script_all.sh index 1f553e3..53f0ef8 100755 --- a/execute_script_all.sh +++ b/execute_script_all.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to execute scripts on virtual machines via ssh +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + script=$1 VMs=$(sudo virsh list --state-running --name | grep chalec) diff --git a/migrate_many_to_aunt.sh b/migrate_many_to_aunt.sh index 03d8e36..7e4c2a9 100755 --- a/migrate_many_to_aunt.sh +++ b/migrate_many_to_aunt.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to migrate multiple virtual machine to another host via ssh +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + count=$1 VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R) diff --git a/migrate_many_to_mother.sh b/migrate_many_to_mother.sh index eb30e26..ae38340 100755 --- a/migrate_many_to_mother.sh +++ b/migrate_many_to_mother.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to migrate multiple virtual machines to another host via ssh +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + count=$1 VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R) diff --git a/migrate_to_aunt.sh b/migrate_to_aunt.sh index a9a701a..3291b77 100755 --- a/migrate_to_aunt.sh +++ b/migrate_to_aunt.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to migrate a single virtual machine to another host via ssh +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + vm=$1 if [ -z "$(cat /proc/drbd | grep Connected)" ] diff --git a/migrate_to_britt_p2p.sh b/migrate_to_britt_p2p.sh index 5d61b8e..a2c3e76 100755 --- a/migrate_to_britt_p2p.sh +++ b/migrate_to_britt_p2p.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to migrate a signel machine to another host via ssh p2p +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + vm=$1 echo MIGRATING $vm ... diff --git a/migrate_to_mother.sh b/migrate_to_mother.sh index 541ab0f..d3caa20 100755 --- a/migrate_to_mother.sh +++ b/migrate_to_mother.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to migrate a single virtual machine to another host via ssh +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + vm=$1 if [ -z "$(cat /proc/drbd | grep Connected)" ] diff --git a/migrate_to_mother_p2p.sh b/migrate_to_mother_p2p.sh index 3f00782..9ccc810 100755 --- a/migrate_to_mother_p2p.sh +++ b/migrate_to_mother_p2p.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to migrate a single virtual machine to another host via ssh p2p +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + vm=$1 echo MIGRATING $vm ... diff --git a/old_restore.sh b/old_restore.sh index d075cd2..8661dff 100755 --- a/old_restore.sh +++ b/old_restore.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Old script to restore a backup to a virtual machine disk (PLAN A) +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + vm=$1 date=$2 disk=$3 diff --git a/restore.sh b/restore.sh index d74ae4a..7102c53 100755 --- a/restore.sh +++ b/restore.sh @@ -1,4 +1,20 @@ #!/bin/bash +# Script to restore a virtual machine disk with Borg (plan B) +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # Exit on error set -e diff --git a/split-brain_resolve.sh b/split-brain_resolve.sh index b3a005a..315458b 100755 --- a/split-brain_resolve.sh +++ b/split-brain_resolve.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to solve split brain situations by copying things smartly +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + count=$1 VMs=$(sudo virsh list --state-running --name) diff --git a/start_all.sh b/start_all.sh index a3576fe..b0b63f3 100755 --- a/start_all.sh +++ b/start_all.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Script to start every virtual machine on a given host +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + VMs=$(sudo virsh list --all --name) for vm in $VMs diff --git a/supervision.sh b/supervision.sh index f5af04f..4fed67c 100755 --- a/supervision.sh +++ b/supervision.sh @@ -1,4 +1,21 @@ #!/bin/bash +# Miscelaneous script related to supervision +# +# Copyright (C) 2023 Adrien 'neox' Bourmault +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + ssh $1 < script_superv.sh sudo sed -i "s/NAME=.*/NAME=$1/g" superv_script_isengard.sh