diff --git a/global/overlay/etc/puppet/modules/soc/files/intelmq/install-intelmq.sh b/global/overlay/etc/puppet/modules/soc/files/intelmq/install-intelmq.sh new file mode 100644 index 0000000..fa8cb93 --- /dev/null +++ b/global/overlay/etc/puppet/modules/soc/files/intelmq/install-intelmq.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# +# Script to install IntelMQ +# + +if [ "x$(whoami)" != "xintelmq" ]; then + echo "Exectuing as wrong user." + exit -1 +fi + +if ! test -f /opt/intelmq/venv/bin/activate; then + echo "Issues with venv." + exit -1 +else + source /opt/intelmq/venv/bin/activate +fi + +PY_INTELMQ='intelmq intelmq-api intelmqmail intelmq-manager' +PY_CERTBUND_CONTACT='intelmq-certbund-contact intelmq-fody-backend' + + +pip3 install $PY_INTELMQ +pip3 install $PY_CERTBUND_CONTACT +# Due to Certbund contact overwrite files for some reason, reinstall intelmq +pip3 install --force-reinstall intelmq + +touch /opt/intelmq/.installed diff --git a/global/overlay/etc/puppet/modules/soc/manifests/.intelmq.pp.swp b/global/overlay/etc/puppet/modules/soc/manifests/.intelmq.pp.swp index ff1bddc..5e81c42 100644 Binary files a/global/overlay/etc/puppet/modules/soc/manifests/.intelmq.pp.swp and b/global/overlay/etc/puppet/modules/soc/manifests/.intelmq.pp.swp differ diff --git a/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp b/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp index b871f61..10bcb59 100644 --- a/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp +++ b/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp @@ -11,7 +11,7 @@ class soc::intelmq( groups => 'www-data', home => '/opt/intelmq', managehome => true, - provider => 'useradd', + shell => '/bin/bash', } file { '/etc/intelmq': @@ -25,7 +25,7 @@ class soc::intelmq( # content => template('soc/sso/apache-groups.txt.erb') # } - package { ['apache2', 'libapache2-mod-wsgi-py3', 'postgresql', 'python3-venv', 'python3-pip', 'python3-gpg']: + package { ['apache2', 'libapache2-mod-wsgi-py3', 'postgresql', 'python3-venv', 'python3-pip', 'python3-gpg', 'python3-psycopg2']: ensure => 'latest', } @@ -33,8 +33,13 @@ class soc::intelmq( creates => '/opt/intelmq/venv', } - # Install intelmq and all most stuff around it. - exec { 'sudo -u intelmq /opt/intelmq/venv/bin/pip3 install intelmq intelmq-api intelmq-certbund-contact intelmq-certbund-contact-api intelmq-checkticket-api intelmq-events-api intelmq-fody-backend intelmq-manager intelmq-session intelmq-tickets-api intelmqmail': - creates => '/opt/intelmq/etc', + file { '/opt/intelmq/install-intelmq.sh': + ensure => file, + content => file('soc/intelmq/install-intelmq.sh'), + mode => 0555, + } + + exec { 'sudo -u intelmq /opt/install-intelmq.sh': + creates => '/opt/intelmq/.installed' } }