diff --git a/manifests/site.pp b/manifests/site.pp index 2087e38..50c1ec8 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -2,6 +2,16 @@ Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" , "/usr/local/bin/", "/usr/local/sbin/" ] } +exec { "create_ortiche_directory": + command => "/bin/mkdir -p /etc/ortiche", + creates => "/etc/ortiche", + before => Exec['test_ortiche_host_dir'], +} + +exec {'test_ortiche_host_dir': + command => "false", + unless => "test -d /etc/ortiche/$::hostname", +} user { 'ortiche': ensure => 'present', @@ -30,19 +40,42 @@ node 'snf-30710' { } node 'snf-29152' { + file {"/etc/ssl/certs/tanacetum_mailserver_cert.pem": + ensure => 'present', + source => "/etc/ortiche/$::hostname/certs/ssl-cert-snakeoil.pem", + owner => 'root', + group => 'root', + mode => '0664', + require => Exec['test_ortiche_host_dir'], + } + + file {"/etc/ssl/private/tanacetum_mailserver_key.pem": + ensure => 'present', + source => "/etc/ortiche/$::hostname/private/ssl-cert-snakeoil.key", + owner => 'root', + group => 'root', + mode => '0600', + require => Exec['test_ortiche_host_dir'], + } + host { 'tanacetum.ortiche.net': ensure => 'present', ip => '83.212.126.162', host_aliases => ['tanacetum.indivia.tk', 'tanacetum'], } - + postfix::config { - "relayhost": value => "[smtp.indivia.net]:25"; + "relayhost": value => "[smtp.indivia.net]:25"; + "smtpd_tls_cert_file": value => "/etc/ssl/certs/tanacetum_mailserver_cert.pem"; + "smtpd_tls_key_file" : value => "/etc/ssl/private/tanacetum_mailserver_key.pem"; } + class { 'postfix': myorigin => 'dev_2.indivia.tk', anon_sasl => 'yes', root_mail_recipient => "gestione@posta.indivia.net", + require => [ File['/etc/ssl/certs/tanacetum_mailserver_cert.pem'], + File['/etc/ssl/private/tanacetum_mailserver_key.pem'] ], } }