diff --git a/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp b/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp index e3b1247..061b186 100644 --- a/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp +++ b/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp @@ -189,11 +189,20 @@ class soc::intelmq( require => Package['apache2'], } - exec { 'Enable Apache2 modules': - command => 'a2enmod ssl wsgi proxy proxy_http headers rewrite', + $apache_modules = ['ssl', 'proxy', 'proxy_http', 'headers', 'rewrite',] + $apache_modules.each |String $module| { + exec { 'Enable Apache2 modules': + command => "a2enmod ${module}", + notify => Service['apache2'], + unless => "test -f /etc/apache2/mods-enabled/${module}.load", + } + } + + exec { 'Enable mod_wsgi': + command => 'a2enmod wsgi', require => Package['libapache2-mod-wsgi-py3'], notify => Service['apache2'], - unless => ['test -f /etc/apache2/mods-enabled/headers.load', 'test -f /etc/apache2/mods-enabled/proxy.load', 'test -f /etc/apache2/mods-enabled/proxy_http.load', 'test -f /etc/apache2/mods-enabled/rewrite.load', 'test -f /etc/apache2/mods-enabled/ssl.load', 'test -f /etc/apache2/mods-enabled/wsgi.load', ], + ¦ unless => "test -f /etc/apache2/mods-enabled/${module}.load", } file { '/etc/apache2/conf-available/wsgi-venv.conf':