9
0
Fork 1
soc-ops/global/overlay/etc/puppet/modules/soc/manifests/intelmq.pp

58 lines
1.3 KiB
ObjectPascal
Raw Normal View History

2024-11-13 16:25:14 +01:00
class soc::intelmq(
) {
group { 'intelmq':
ensure => present,
}
user { 'intelmq':
2024-11-13 16:49:11 +01:00
ensure => present,
gid => 'intelmq',
groups => 'www-data',
home => '/opt/intelmq',
managehome => true,
2024-11-14 10:24:57 +01:00
shell => '/bin/bash',
2024-11-13 16:25:14 +01:00
}
file { '/etc/intelmq':
ensure => directory,
owner => 'intelmq',
group => 'intelmq',
}
# file { '/opt/sso/apache/groups.txt':
# ensure => file,
# content => template('soc/sso/apache-groups.txt.erb')
# }
2024-11-14 10:24:57 +01:00
package { ['apache2', 'libapache2-mod-wsgi-py3', 'postgresql', 'python3-venv', 'python3-pip', 'python3-gpg', 'python3-psycopg2']:
2024-11-13 16:25:14 +01:00
ensure => 'latest',
}
exec { 'sudo -u intelmq /usr/bin/python3 -m venv --system-site-packages /opt/intelmq/venv':
creates => '/opt/intelmq/venv',
}
2024-11-14 10:24:57 +01:00
file { '/opt/intelmq/install-intelmq.sh':
ensure => file,
content => file('soc/intelmq/install-intelmq.sh'),
2024-11-14 10:27:12 +01:00
mode => '0555',
2024-11-14 10:24:57 +01:00
}
2024-11-14 10:28:47 +01:00
exec { 'sudo -u intelmq /opt/intelmq/install-intelmq.sh':
2024-11-14 10:24:57 +01:00
creates => '/opt/intelmq/.installed'
2024-11-13 16:25:14 +01:00
}
2024-11-14 10:51:10 +01:00
exec { '/opt/intelmq/venv/bin/intelmqsetup --state-file /opt/intelmq/.setup_state':
2024-11-14 10:56:12 +01:00
creates => '/opt/intelmq/.setup_state'
2024-11-14 10:58:00 +01:00
returns => ['0', '1', ],
2024-11-14 10:51:10 +01:00
}
2024-11-14 10:52:32 +01:00
file { '/etc/sudoers.d/01_intelmq-api':
2024-11-14 10:51:10 +01:00
ensure => file,
content => file('soc/intelmq/sudoers-01-intelmq-api'),
mode => '0440',
}
2024-11-13 16:25:14 +01:00
}