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.sh | 237 ------------------------------- bin/install_script_ovh_cloud_instance.sh | 182 ++++++++++++++++++++++++ bin/install_script_ovh_vps_ssd.sh | 237 +++++++++++++++++++++++++++++++ 3 files changed, 419 insertions(+), 237 deletions(-) delete mode 100755 bin/install_script.sh create mode 100755 bin/install_script_ovh_cloud_instance.sh create mode 100755 bin/install_script_ovh_vps_ssd.sh (limited to 'bin') diff --git a/bin/install_script.sh b/bin/install_script.sh deleted file mode 100755 index 6b1aa39..0000000 --- a/bin/install_script.sh +++ /dev/null @@ -1,237 +0,0 @@ -#!/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 < $ARCH_PUPPET_INITIAL_CONFIGURATION +host_address=$(python $PYTHON_DIRECTORY/get_initial_configuration_cloud_instance.py $instance_id | jq -r '.ips.v4.ipAddress') + +cat > $ARCH_HOST_SCRIPT < $ARCH_INSTALL_SCRIPT < $ARCH_PUPPET_CONFIGURATION_SCRIPT < $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT < $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 <