aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/bootstrap.sh
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2018-09-22 15:29:45 +0200
committerEmil Renner Berthing <esmil@labitat.dk>2018-11-10 22:31:14 +0100
commit311893c3bc2bbd18669b5c80bf884e9d25889b74 (patch)
tree19b9b3664a9d29fcd30cf82ccf82037be5c9f726 /roles/space_server/bootstrap.sh
parent9454fdbff511e965e4fd9eb187b7fe432dcd437e (diff)
downloadlabitat-ansible-311893c3bc2bbd18669b5c80bf884e9d25889b74.tar.gz
labitat-ansible-311893c3bc2bbd18669b5c80bf884e9d25889b74.tar.xz
labitat-ansible-311893c3bc2bbd18669b5c80bf884e9d25889b74.zip
space_server: update for Fedora 29
Diffstat (limited to 'roles/space_server/bootstrap.sh')
-rwxr-xr-xroles/space_server/bootstrap.sh31
1 files changed, 24 insertions, 7 deletions
diff --git a/roles/space_server/bootstrap.sh b/roles/space_server/bootstrap.sh
index f80a454..98a62e5 100755
--- a/roles/space_server/bootstrap.sh
+++ b/roles/space_server/bootstrap.sh
@@ -23,8 +23,9 @@
#
# Install syslinux:
# mount -o noatime,fmask=0133,dmask=0022,utf8 /dev/sda1 /boot
+# mkdir /boot/syslinux
# syslinux -d syslinux -i /dev/sda1
-# cp /usr/share/syslinux/{ldlinux,libutil,menu}.c32 /boot/syslinux/
+# cp /usr/share/syslinux/{libutil,menu}.c32 /boot/syslinux/
# dd bs=440 count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda
#
# Mount root filesystem:
@@ -39,7 +40,7 @@
set -e
set -x
-release=27
+release=29
secrets='/etc/ansible/secrets.yml'
dest="/mnt/fedora$release"
if [[ -e "$dest" ]]; then
@@ -57,15 +58,31 @@ dnf \
--disablerepo='*' \
--enablerepo=fedora \
--enablerepo=updates \
- install dnf git python2-dnf python-netaddr ansible
+ install glibc-langpack-en dnf git ansible python3-netaddr python-unversioned-command
if [[ -f "$secrets" ]]; then
install -m660 "$secrets" "$dest$secrets"
fi
-systemd-nspawn -D "$dest" -M space -E ANSIBLE_FORCE_COLOR=1 \
- --bind /boot --bind /home -- \
- ansible-pull -i space, -c local \
- -U 'https://github.com/labitat/labitat-ansible.git' space.yml
+for i in /var/lib/machines /var/lib/portables; do
+ if [[ -d "$dest$i" ]]; then
+ btrfs subvolume delete "$dest$i"
+ fi
+ echo "Creating $i"
+ install -o root -g root -m755 -d "$dest$i"
+done
+
+exec systemd-nspawn \
+ -D "$dest" \
+ -M space \
+ -E ANSIBLE_FORCE_COLOR=1 \
+ --bind /boot \
+ --bind /home \
+ -- \
+ ansible-pull \
+ -i space.labitat.dk, \
+ -c local \
+ -U 'https://github.com/labitat/labitat-ansible.git' \
+ space.yml
# vim: set ts=2 sw=2 et: