summaryrefslogtreecommitdiff
path: root/puppet/modules/site_sshd
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/site_sshd')
-rw-r--r--puppet/modules/site_sshd/files/xterm-title.sh8
-rw-r--r--puppet/modules/site_sshd/manifests/init.pp42
2 files changed, 49 insertions, 1 deletions
diff --git a/puppet/modules/site_sshd/files/xterm-title.sh b/puppet/modules/site_sshd/files/xterm-title.sh
new file mode 100644
index 00000000..3cff0e3a
--- /dev/null
+++ b/puppet/modules/site_sshd/files/xterm-title.sh
@@ -0,0 +1,8 @@
+# If this is an xterm set the title to user@host:dir
+case "$TERM" in
+xterm*|rxvt*)
+ PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
+ ;;
+*)
+ ;;
+esac
diff --git a/puppet/modules/site_sshd/manifests/init.pp b/puppet/modules/site_sshd/manifests/init.pp
index 630e9bdf..c1c4d3b3 100644
--- a/puppet/modules/site_sshd/manifests/init.pp
+++ b/puppet/modules/site_sshd/manifests/init.pp
@@ -1 +1,41 @@
-class site_sshd {}
+class site_sshd {
+ $ssh = hiera_hash('ssh')
+
+ ##
+ ## XTERM TITLE
+ ##
+
+ file {'/etc/profile.d/xterm-title.sh':
+ source => "puppet://$server/modules/site_sshd/xterm-title.sh",
+ owner => root, group => 0, mode => 0644;
+ }
+
+ ##
+ ## OPTIONAL MOSH SUPPORT
+ ##
+
+ $mosh = $ssh['mosh']
+ $mosh_ports = $mosh['ports']
+ if $ssh['mosh']['enabled'] {
+ $mosh_ensure = present
+ } else {
+ $mosh_ensure = absent
+ }
+
+ package { 'mosh':
+ ensure => $mosh_ensure;
+ }
+ file { '/etc/shorewall/macro.mosh':
+ ensure => $mosh_ensure,
+ content => "PARAM - - udp $mosh_ports",
+ notify => Service['shorewall'],
+ require => Package['shorewall'];
+ }
+ shorewall::rule { 'net2fw-mosh':
+ ensure => $mosh_ensure,
+ source => 'net',
+ destination => '$FW',
+ action => 'mosh(ACCEPT)',
+ order => 200;
+ }
+}