summaryrefslogtreecommitdiff
path: root/roles/cloud/install/templates/hetzner_postinst.sh.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-07-04 23:26:09 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-07-04 23:26:09 +0200
commitceafa5b30eec02940c6a62526fa81c09d40b1b59 (patch)
treeaf076e4a9d7441cb051cafe600e85dd7274188f9 /roles/cloud/install/templates/hetzner_postinst.sh.j2
parentmove usb install role to installer/debian/ (diff)
parentinstall/preseed: convert old host configs to new partman layout (diff)
Merge branch 'topic/preseed-configurable-disk-layout-contd'
Diffstat (limited to 'roles/cloud/install/templates/hetzner_postinst.sh.j2')
-rw-r--r--roles/cloud/install/templates/hetzner_postinst.sh.j210
1 files changed, 8 insertions, 2 deletions
diff --git a/roles/cloud/install/templates/hetzner_postinst.sh.j2 b/roles/cloud/install/templates/hetzner_postinst.sh.j2
index 613f57ac..d9de15c9 100644
--- a/roles/cloud/install/templates/hetzner_postinst.sh.j2
+++ b/roles/cloud/install/templates/hetzner_postinst.sh.j2
@@ -27,7 +27,12 @@ passwd -d root && passwd -l root
{% if install_distro == "debian" %}
sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces
{% endif %}
-sed -r 's#(\s+/var/log\s+ext4\s+)defaults#\1noatime,nodev,noexec#g' -i /etc/fstab
+{% set system_lvm_volumes = install_cooked.system_lvm.volumes | default(hetzner_system_lvm_volumes_default) %}
+{% for volume in system_lvm_volumes %}
+{% if 'mount_options' in volume %}
+sed -r 's#(\s+{{ volume.mountpoint }}\s+{{ volume.filesystem }}\s+)defaults#\1{{ volume.mount_options | join(",") }}#g' -i /etc/fstab
+{% endif %}
+{% endfor %}
mkdir -p -m 0700 /target/root/.ssh
cat <<EOK > /root/.ssh/authorized_keys
@@ -42,7 +47,8 @@ swapoff -a
sed -e '/^\/swapfile/d' -i /etc/fstab
rm -f /swapfile
-{% if install_cooked.disks.root_lvm_size != "all" %}
+{% set system_lvm_size = install_cooked.system_lvm.size | default('all') %}
+{% if system_lvm_size != "all" %}
sed -e '/\/dummy/d' -i /etc/fstab
cat > /post-install-finalize <<EOF