diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-05-26 22:26:43 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-05-26 22:26:43 -0300 |
commit | ec572315080690b9d7f1930fd175403aa004d8ab (patch) | |
tree | f536a788e2ce5f5f7f501f5c7d30b5492f2d529a | |
parent | e96c97b4a3468b9c164f3bfcfc7db969f441e49b (diff) | |
download | puppet-nodo-ec572315080690b9d7f1930fd175403aa004d8ab.tar.gz puppet-nodo-ec572315080690b9d7f1930fd175403aa004d8ab.tar.bz2 |
Adding system-wide screen session
-rw-r--r-- | files/etc/rc.local | 5 | ||||
-rw-r--r-- | manifests/base.pp | 2 | ||||
-rw-r--r-- | manifests/subsystem/profile.pp | 8 | ||||
-rw-r--r-- | manifests/subsystem/screen.pp | 9 | ||||
-rw-r--r-- | manifests/subsystem/screen/startup.pp | 12 | ||||
-rw-r--r-- | templates/screen/screenrc.erb (renamed from files/etc/screenrc) | 8 |
6 files changed, 36 insertions, 8 deletions
diff --git a/files/etc/rc.local b/files/etc/rc.local index 4b8a41e..c9a8046 100644 --- a/files/etc/rc.local +++ b/files/etc/rc.local @@ -35,5 +35,10 @@ if [ -f '/etc/init.d/shorewall' ]; then /etc/init.d/shorewall restart fi +# Start system-wide screen session +if [ -f "/etc/screenrc.startup" ]; then + /usr/bin/screen -d -m -S root -f /etc/screenrc.startup +fi + # Then exit exit 0 diff --git a/manifests/base.pp b/manifests/base.pp index 88af553..687619d 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -6,6 +6,8 @@ class nodo::base { include nodo::subsystem::sudo include nodo::subsystem::locales include nodo::subsystem::profile + include nodo::subsystem::screen + include nodo::subsystem::screen::startup include nodo::subsystem::apt include nodo::subsystem::backup include nodo::subsystem::mail diff --git a/manifests/subsystem/profile.pp b/manifests/subsystem/profile.pp index b90ac65..33ddc6a 100644 --- a/manifests/subsystem/profile.pp +++ b/manifests/subsystem/profile.pp @@ -1,13 +1,5 @@ # Custom configuration for user profiles class nodo::subsystem::profile { - file { "/etc/screenrc": - source => "puppet:///modules/nodo/etc/screenrc", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - } - # As of squeeze, custom configuration can be placed directly at # /etc/profile.d, so in the future this file won't need to be # managed by puppet anymore. diff --git a/manifests/subsystem/screen.pp b/manifests/subsystem/screen.pp new file mode 100644 index 0000000..bcc2450 --- /dev/null +++ b/manifests/subsystem/screen.pp @@ -0,0 +1,9 @@ +class nodo::subsystem::screen { + file { "/etc/screenrc": + content => template('nodo/screen/screenrc.erb'), + owner => "root", + group => "root", + mode => 0644, + ensure => present, + } +} diff --git a/manifests/subsystem/screen/startup.pp b/manifests/subsystem/screen/startup.pp new file mode 100644 index 0000000..ffbec08 --- /dev/null +++ b/manifests/subsystem/screen/startup.pp @@ -0,0 +1,12 @@ +class nodo::subsytem::screen::startup( + $windows = hiera('nodo::subsystem::screen::startup::windows', [ "${::hostname} 0 tail -F /var/log/daemon.log" ]), + $select = hiera('nodo::subsystem::screen::startup::select', 0) +) { + file { "/etc/screenrc.startup": + content => template('nodo/screen/screenrc.erb'), + owner => "root", + group => "root", + mode => 0644, + ensure => present, + } +} diff --git a/files/etc/screenrc b/templates/screen/screenrc.erb index eb68114..722aabc 100644 --- a/files/etc/screenrc +++ b/templates/screen/screenrc.erb @@ -128,6 +128,14 @@ bind ^] paste [.] # screen -t local 0 # screen -t mail 1 elm # screen -t 40 2 rlogin faui40 +<%- if windows != '' then -%> +<% windows.each do |line| -%> +screen -t <%= line %> +<%- end -%> +<%- end -%> +<%- if select != '' then -%> +select <%= select %> +<%- end -%> # caption always "%3n %t%? @%u%?%? [%h]%?" # hardstatus alwaysignore |