summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'puppet')
-rw-r--r--puppet/modules/site_config/manifests/sshd.pp2
-rw-r--r--puppet/modules/site_sshd/files/xterm-title.sh8
-rw-r--r--puppet/modules/site_sshd/manifests/init.pp42
3 files changed, 50 insertions, 2 deletions
diff --git a/puppet/modules/site_config/manifests/sshd.pp b/puppet/modules/site_config/manifests/sshd.pp
index 944dbce2..8ff337a0 100644
--- a/puppet/modules/site_config/manifests/sshd.pp
+++ b/puppet/modules/site_config/manifests/sshd.pp
@@ -2,7 +2,7 @@ class site_config::sshd {
# configure sshd
include sshd
include site_sshd
- # no need for configuring authorized_keys as leap_cli cares for that
+ # no need for configuring authorized_keys as leap_cli cares for that
#$ssh_pubkeys=hiera_hash('ssh_pubkeys')
#notice($ssh_pubkeys)
#create_resources('site_sshd::ssh_key', $ssh_pubkeys)
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;
+ }
+}