diff options
-rw-r--r-- | provider_base/common.json | 6 | ||||
-rw-r--r-- | puppet/modules/site_config/manifests/sshd.pp | 2 | ||||
-rw-r--r-- | puppet/modules/site_sshd/files/xterm-title.sh | 8 | ||||
-rw-r--r-- | puppet/modules/site_sshd/manifests/init.pp | 42 |
4 files changed, 55 insertions, 3 deletions
diff --git a/provider_base/common.json b/provider_base/common.json index d3ae84ff..ade409a6 100644 --- a/provider_base/common.json +++ b/provider_base/common.json @@ -16,7 +16,11 @@ "ssh": { "authorized_keys": "= file :authorized_keys", "known_hosts": "=> known_hosts_file", - "port": 22 + "port": 22, + "mosh": { + "ports": "60000:61000", + "enabled": false + } }, "hosts": "=> hosts_file", "x509": { 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; + } +} |