diff --git a/puppet/kandra/manifests/prod_app_frontend_once.pp b/puppet/kandra/manifests/prod_app_frontend_once.pp index 25b4e21ddd..68767a9727 100644 --- a/puppet/kandra/manifests/prod_app_frontend_once.pp +++ b/puppet/kandra/manifests/prod_app_frontend_once.pp @@ -24,8 +24,9 @@ class kandra::prod_app_frontend_once { command => '/usr/lib/nagios/plugins/zulip_app_frontend/check_send_receive_time --site=https://$(/home/zulip/deployments/current/scripts/get-django-setting NAGIOS_BOT_HOST) >/dev/null', } zulip::cron { 'check_user_zephyr_mirror_liveness': - hour => '*', - minute => '*', - command => '/usr/lib/nagios/plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness >/dev/null', + hour => '*', + minute => '*', + command => '/usr/lib/nagios/plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness >/dev/null', + use_proxy => false, } } diff --git a/puppet/zulip/manifests/cron.pp b/puppet/zulip/manifests/cron.pp index 49f4855530..7380363951 100644 --- a/puppet/zulip/manifests/cron.pp +++ b/puppet/zulip/manifests/cron.pp @@ -7,7 +7,20 @@ define zulip::cron( String $user = 'zulip', Optional[String] $command = undef, Optional[String] $manage = undef, + Boolean $use_proxy = true, ) { + if $use_proxy { + $proxy_host = zulipconf('http_proxy', 'host', 'localhost') + $proxy_port = zulipconf('http_proxy', 'port', '4750') + if $proxy_host != '' and $proxy_port != '' { + $proxy = "http://${proxy_host}:${proxy_port}" + } else { + $proxy = '' + } + } else { + $pxoy = '' + } + $dsn = zulipconf('sentry', 'project_dsn', '') if $dsn != '' { include zulip::sentry_cli diff --git a/puppet/zulip/templates/cron.template.erb b/puppet/zulip/templates/cron.template.erb index a8dee5ebfe..0c6fe9fa4e 100644 --- a/puppet/zulip/templates/cron.template.erb +++ b/puppet/zulip/templates/cron.template.erb @@ -2,9 +2,13 @@ MAILTO=zulip PATH=/usr/local/bin:/usr/bin:/bin SHELL=/bin/bash USER=<%= @user %> -<% if @dsn != '' %> +<% if @proxy != '' -%> +HTTP_proxy="<%= @proxy %>" +HTTPS_proxy="<%= @proxy %>" +<% end -%> +<% if @dsn != '' -%> SENTRY_DSN=<%= @dsn %> -<% end %> +<% end -%> <%= @minute %> <%= @hour %> * * <%= @dow %> <%= @user %> <%= @run %>