Make rc.local a template, make swap on zani
authorPeter Palfrader <peter@palfrader.org>
Sun, 15 Feb 2015 18:09:13 +0000 (19:09 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sun, 15 Feb 2015 18:09:13 +0000 (19:09 +0100)
modules/debian-org/files/rc.local [deleted file]
modules/debian-org/manifests/init.pp
modules/debian-org/templates/rc.local.erb [new file with mode: 0755]

diff --git a/modules/debian-org/files/rc.local b/modules/debian-org/files/rc.local
deleted file mode 100755 (executable)
index d947009..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-if [ -e /proc/sys/kernel/modules_disabled ]; then
-       ( sleep 60;
-         echo 1 > /proc/sys/kernel/modules_disabled || true
-       ) & disown
-fi
-
-touch /var/run/reboot-lock
index db9e9d3..dc9d272 100644 (file)
@@ -287,7 +287,7 @@ class debian-org {
        }
        file { '/etc/rc.local':
                mode   => '0755',
-               source => 'puppet:///modules/debian-org/rc.local',
+               content => template('debian-org/rc.local.erb'),
                notify => Exec['service rc.local start'],
        }
        file { '/etc/dsa':
diff --git a/modules/debian-org/templates/rc.local.erb b/modules/debian-org/templates/rc.local.erb
new file mode 100755 (executable)
index 0000000..b6016e7
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+if [ -e /proc/sys/kernel/modules_disabled ]; then
+       ( sleep 60;
+         echo 1 > /proc/sys/kernel/modules_disabled || true
+       ) & disown
+fi
+
+touch /var/run/reboot-lock
+<%- if hostname == "zani" then -%>
+  if [ -n "$(awk '$4 == "dasdb1" && $3 == "249999" {print}' /proc/partitions)" ]; then
+    mkswap /dev/dasdb1 && swapon /dev/dasdb1
+  fi
+<%- end -%>