9
0
Fork 1

Testing stuff for mailgen

This commit is contained in:
Johan Björklund 2024-11-21 10:47:51 +01:00
parent 3f18f25070
commit 5a62a54e3c
Signed by: bjorklund
GPG key ID: 5E8401339C7F5037
2 changed files with 17 additions and 0 deletions

View file

@ -14,6 +14,7 @@ class soc::intelmq(
$api_pass = lookup('intelmq_api_user.password', undef, undef, 'pass') $api_pass = lookup('intelmq_api_user.password', undef, undef, 'pass')
$db_user = lookup('intelmq_db_user.username', undef, undef, 'test') $db_user = lookup('intelmq_db_user.username', undef, undef, 'test')
$db_pass = lookup('intelmq_db_user.password', undef, undef, 'pass') $db_pass = lookup('intelmq_db_user.password', undef, undef, 'pass')
$privkey = lookup('gnupg.keyid', undef, undef, undef)
group { 'intelmq': group { 'intelmq':
ensure => present, ensure => present,
@ -298,7 +299,22 @@ class soc::intelmq(
mode => '0440', mode => '0440',
content => template('soc/intelmq/intelmq-mailgen.conf.erb'), content => template('soc/intelmq/intelmq-mailgen.conf.erb'),
; ;
}
file { '/opt/intelmq/.gnupg':
ensure => directory,
owner => 'intelmq',
group => 'intelmq',
mode => '0700',
}
if lookup('gnupg.privkey', undef, undef, undef) != undef {
sunet::snippets::secret_file { "/opt/intelmq/.gnupg/${privkey}.asc":
hiera_key => 'gnupg.privkey'
}
exec { 'Import private gpg key':
command => "sudo -u intelmq /usr/bin/gpg -import /opt/intelmq/.gnupg/${privkey}.asc",
unless => "gpg -K ${privkey} 2>&1 > /dev/null",
}
} }
file { '/etc/systemd/system/intelmq-api.service': file { '/etc/systemd/system/intelmq-api.service':

File diff suppressed because one or more lines are too long