From 6eae0c9b006e8600cfed265978d40e3cdd17dab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bj=C3=B6rklund?= Date: Thu, 14 Nov 2024 12:47:14 +0100 Subject: [PATCH] Fixes with apache config. --- .../soc/files/intelmq/apache/wsgi-venv.conf | 3 +++ .../etc/puppet/modules/soc/manifests/intelmq.pp | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 global/overlay/etc/puppet/modules/soc/files/intelmq/apache/wsgi-venv.conf diff --git a/global/overlay/etc/puppet/modules/soc/files/intelmq/apache/wsgi-venv.conf b/global/overlay/etc/puppet/modules/soc/files/intelmq/apache/wsgi-venv.conf new file mode 100644 index 0000000..7d70c65 --- /dev/null +++ b/global/overlay/etc/puppet/modules/soc/files/intelmq/apache/wsgi-venv.conf @@ -0,0 +1,3 @@ + + WSGIPythonHome /opt/intelmq/venv + diff --git a/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp b/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp index 32e4815..03fc49e 100644 --- a/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp +++ b/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp @@ -72,7 +72,21 @@ class soc::intelmq( } exec { 'Enable Apache2 modules': - command => 'a2enmod ssl wsgi proxy proxy_http header rewrite', + command => 'a2enmod ssl wsgi proxy proxy_http headers rewrite', require => Package['libapache2-mod-wsgi-py3'], + notify => Service['apache2'], } + + file { '/etc/apache2/conf-available/wsgi-venv.conf': + ensure => file, + content => file('soc/intelmq/apache/wsgi-venv.conf'), + } + + exec { 'Enable wsgi-venv conf': + command => 'a2enconf wsgi-venv' + creates => '/etc/apache2/conf-enabled/wsgi-venv.conf' + require => File('/etc/apache2/conf-available/wsgi-venv.conf'), + notify => Service['apache2'], + } + }