aboutsummaryrefslogtreecommitdiff
path: root/scripts/ovh_cloud_instance
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-16 00:22:38 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-16 18:08:12 +0100
commitc15f2234474ff8a8266e26856702b3c561050667 (patch)
tree5df6dfb44ee2d37fbd9cf7b701bdc7881c575857 /scripts/ovh_cloud_instance
parent985b53a258ee18eaca8d437ae532c232a6d19921 (diff)
downloadPuppet-c15f2234474ff8a8266e26856702b3c561050667.tar.gz
Puppet-c15f2234474ff8a8266e26856702b3c561050667.tar.zst
Puppet-c15f2234474ff8a8266e26856702b3c561050667.zip
Move scripts to separate chunks
Diffstat (limited to 'scripts/ovh_cloud_instance')
-rwxr-xr-xscripts/ovh_cloud_instance/arch_host_puppet_configuration_script.sh11
-rwxr-xr-xscripts/ovh_cloud_instance/arch_host_script.sh50
2 files changed, 61 insertions, 0 deletions
diff --git a/scripts/ovh_cloud_instance/arch_host_puppet_configuration_script.sh b/scripts/ovh_cloud_instance/arch_host_puppet_configuration_script.sh
new file mode 100755
index 0000000..b58e255
--- /dev/null
+++ b/scripts/ovh_cloud_instance/arch_host_puppet_configuration_script.sh
@@ -0,0 +1,11 @@
1#!/bin/bash
2
3git_branch="$1"
4environment="$2"
5
6MOUNTPOINT=/mnt
7
8sudo cp /tmp/arch_puppet_configuration_script.sh "$MOUNTPOINT/root/"
9
10sudo arch-chroot "$MOUNTPOINT" /root/arch_puppet_configuration_script.sh "$git_branch" "$environment"
11
diff --git a/scripts/ovh_cloud_instance/arch_host_script.sh b/scripts/ovh_cloud_instance/arch_host_script.sh
new file mode 100755
index 0000000..c188514
--- /dev/null
+++ b/scripts/ovh_cloud_instance/arch_host_script.sh
@@ -0,0 +1,50 @@
1#!/bin/bash
2
3set -e
4
5git_branch="$1"
6environment="$2"
7
8# Randomizer
9sudo haveged &
10# /Randomizer
11
12# Prepare an arch chroot
13sudo pacman -Sy --noconfirm arch-install-scripts
14# /Prepare an arch chroot
15
16# Prepare device information
17DEVICE=/dev/vdb1
18MOUNTPOINT=/mnt
19
20UUID=$(lsblk -rno UUID "$DEVICE")
21PART="/dev/disk/by-uuid/$UUID"
22# /Prepare device information
23
24# Install very basic system (base git puppet)
25# mkfs.ext4 -F -U "$UUID" "$DEVICE"
26sudo mount "$DEVICE" /mnt
27
28##### FIXME: mkfs.ext4 would be better ####
29for i in /mnt/*; do
30 if [ "$i" = "/mnt/boot" ]; then
31 # keep /boot/grub
32 sudo rm -f $i/*
33 else
34 sudo rm -rf $i
35 fi
36done
37##### /FIXME ####
38
39sudo pacstrap /mnt base git puppet
40
41echo "$PART / auto defaults 0 1" | sudo tee /mnt/etc/fstab
42# /Install very basic system
43
44# Install rest of system (via puppet)
45sudo cp /tmp/arch_install_script.sh "$MOUNTPOINT/root/"
46sudo cp /tmp/puppet_variables.json "$MOUNTPOINT/root/"
47
48sudo arch-chroot "$MOUNTPOINT" /root/arch_install_script.sh "$git_branch" "$environment"
49# /Install rest of system
50