From: Peter Palfrader Date: Sun, 15 Feb 2015 18:09:13 +0000 (+0100) Subject: Make rc.local a template, make swap on zani X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6d240e987cbbabf6e66b22553ec1f1d3fc2bc3d6;hp=47287f7421d22048db82e34af609b927918a70eb;p=dsa-puppet.git Make rc.local a template, make swap on zani --- diff --git a/modules/debian-org/files/rc.local b/modules/debian-org/files/rc.local deleted file mode 100755 index d947009b..00000000 --- a/modules/debian-org/files/rc.local +++ /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 diff --git a/modules/debian-org/manifests/init.pp b/modules/debian-org/manifests/init.pp index db9e9d37..dc9d2722 100644 --- a/modules/debian-org/manifests/init.pp +++ b/modules/debian-org/manifests/init.pp @@ -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 index 00000000..b6016e7e --- /dev/null +++ b/modules/debian-org/templates/rc.local.erb @@ -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 -%>