Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Use existing autossh tunnels as OpenSSH "master" sockets.

Alex Vandiver42f84a8cc7fe
diff --git a/puppet/zulip_ops/files/nagios_ssh_config b/puppet/zulip_ops/files/nagios_ssh_config
new file mode 100644
index 00000000000..4e6d9d5ea8c
--- /dev/null
+++ b/puppet/zulip_ops/files/nagios_ssh_config
@@ -0,0 +1,6 @@
+Host *
+ ControlMaster no
+ ControlPath /tmp/ssh-%C
+
+ ServerAliveInterval 30
+ ServerAliveCountMax 3
diff --git a/puppet/zulip_ops/manifests/profile/nagios.pp b/puppet/zulip_ops/manifests/profile/nagios.pp
index 8cba3ebcce9..abcef192dd3 100644
--- a/puppet/zulip_ops/manifests/profile/nagios.pp
+++ b/puppet/zulip_ops/manifests/profile/nagios.pp
@@ -140,6 +140,14 @@ class zulip_ops::profile::nagios {
require => File['/var/lib/nagios'],
}
+ file { '/var/lib/nagios/.ssh/config':
+ ensure => file,
+ mode => '0644',
+ owner => 'nagios',
+ group => 'nagios',
+ source => 'puppet:///modules/zulip_ops/nagios_ssh_config',
+ }
+
# Disable apparmor for msmtp so it can read the above config file
file { '/etc/apparmor.d/disable/usr.bin.msmtp':
ensure => link,
diff --git a/puppet/zulip_ops/templates/supervisor/conf.d/munin_tunnels.conf.erb b/puppet/zulip_ops/templates/supervisor/conf.d/munin_tunnels.conf.erb
index ef051b695e4..acecacf4ed7 100644
--- a/puppet/zulip_ops/templates/supervisor/conf.d/munin_tunnels.conf.erb
+++ b/puppet/zulip_ops/templates/supervisor/conf.d/munin_tunnels.conf.erb
@@ -5,7 +5,7 @@ i = 0
@hosts.each do |host|
-%>
[program:munin-tunnel-<%= host %>]
-command=autossh -N -M <%= 20000 + 2 * i %> -L <%= 5000 + i %>:localhost:4949 nagios@<%= host %><% unless host.include?(".") %>.<%= @default_host_domain %><% end %>
+command=autossh -N -M <%= 20000 + 2 * i %> -L <%= 5000 + i %>:localhost:4949 -o ControlMaster=yes nagios@<%= host %><% unless host.include?(".") %>.<%= @default_host_domain %><% end %>
priority=200 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true)
autorestart=true ; whether/when to restart (default: unexpected)