diff --git a/manifests/init.pp b/manifests/init.pp index 1f75f31f7be7884abe0ca3f1271aebded1e8f661..6e26797d63ae3d147969b6a07ac166b445543b3c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,8 @@ # This manifest is intended to manage studieinfo.lysator.liu.se class studieinfo { - $socket = '/tmp/studieinfo.sock' + $sockdir = 'studieinfo' + $socket = "/run/${sockdir}/studieinfo.sock" $uwsgi_host = 'localhost' $uwsgi_port = 8000 @@ -27,6 +28,26 @@ class studieinfo { ensure => latest, } + + $dropin = '/etc/systemd/system/studieinfo-web.service.d/override.conf' + file { dirname($dropin): + ensure => directory, + } + + # Needed since nginx.service contains PrivateTmp=true since some + # version back. Meaning that it couldn't find the UWSGI socket + # there. + # That flag could be turned off, but it seems more robust to + # actually put the socket into /run + file { $dropin: + ensure => file, + notify => Service['studieinfo-web'], + content => @("EOF") + [Service] + RuntimeDirectory=${sockdir} + | EOF + } + service { 'studieinfo-web': ensure => running, enable => true, @@ -44,6 +65,7 @@ class studieinfo { class { '::nginx': proxy_cache_path => '/tmp/cache', proxy_use_temp_path => 'off', + # TODO flush this after seacrh backend reload proxy_cache_keys_zone => 'search_cache:100m', gzip => 'on', http_tcp_nopush => 'on', @@ -148,7 +170,7 @@ class studieinfo { location_cfg_append => { include => 'uwsgi_params', - uwsgi_pass => "unix:${socket}", + uwsgi_pass => "unix://${socket}", }, }