From df0c42af3366f013afa1ee13eed04307260beae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 11 Mar 2018 12:26:28 +0100 Subject: Add scripts for ovh cloud --- bin/install_script_ovh_vps_ssd.sh | 237 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100755 bin/install_script_ovh_vps_ssd.sh (limited to 'bin/install_script_ovh_vps_ssd.sh') diff --git a/bin/install_script_ovh_vps_ssd.sh b/bin/install_script_ovh_vps_ssd.sh new file mode 100755 index 0000000..6b1aa39 --- /dev/null +++ b/bin/install_script_ovh_vps_ssd.sh @@ -0,0 +1,237 @@ +#!/bin/bash + +usage() { +cat < $ARCH_PUPPET_INITIAL_CONFIGURATION + +cat > $ARCH_HOST_SCRIPT < /tmp/root.x86_64/etc/pacman.d/mirrorlist + +DEVICE_STR=\$(cat /proc/mounts | grep "/dev/[sv]d.. /mnt/") +DEVICE=\$(echo "\$DEVICE_STR" | cut -d' ' -f1) +MOUNTPOINT=\$(echo "\$DEVICE_STR" | cut -d' ' -f2) + +umount "\$DEVICE" +UUID=\$(lsblk -rno UUID "\$DEVICE") + +echo "\$UUID" > /tmp/root.x86_64/device_uuid + +cp /tmp/arch_chroot_script.sh /tmp/root.x86_64/ + +/tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/ /arch_chroot_script.sh + +mount "\$DEVICE" + +cp /tmp/arch_install_script.sh "\$MOUNTPOINT/root/" +cp /tmp/puppet_variables.json "\$MOUNTPOINT/root/" + +/tmp/root.x86_64/bin/arch-chroot "\$MOUNTPOINT" /root/arch_install_script.sh +EOF + + +cat > $ARCH_CHROOT_SCRIPT < /mnt/etc/fstab + +umount /mnt +EOF + +cat > $ARCH_INSTALL_SCRIPT < $ARCH_PUPPET_CONFIGURATION_SCRIPT < $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT <