diff --git a/manifests/bureau.pp b/manifests/bureau.pp index ef8066c..fbefad2 100644 --- a/manifests/bureau.pp +++ b/manifests/bureau.pp @@ -66,4 +66,41 @@ class alternc::bureau ( -> Package['alternc'] ~> Exec['alternc.install'] ~> Exec['alternc.restartapache'] + + # Configuration to be updated once AlternC is already installed + # changing the preseed post-installation doesn't help immediately + # so we ensure relevat configuration values in /etc/alternc/local.sh + alternc::conf::local { 'HOSTING': + value => $panel_title + } + alternc::conf::local { 'FQDN': + value => $panel_hostname, + } + alternc::conf::local { 'PUBLIC_IP': + value => $panel_public_ip, + } + alternc::conf::local { 'INTERNAL_IP': + value => $panel_internal_ip, + } + alternc::conf::local { 'NS1_HOSTNAME': + value => $ns_primary, + } + alternc::conf::local { 'NS2_HOSTNAME': + value => $ns_secondary, + } + alternc::conf::local { 'DEFAULT_MX': + value => $mx_primary, + } + alternc::conf::local { 'DEFAULT_SECONDARY_MX': + value => $mx_secondary, + } + alternc::conf::local { 'ALTERNC_HTML': + value => $html_directory, + } + alternc::conf::local { 'ALTERNC_MAIL': + value => $mail_directory, + } + alternc::conf::local { 'ALTERNC_LOGS': + value => $logs_directory, + } } diff --git a/manifests/conf/local.pp b/manifests/conf/local.pp new file mode 100644 index 0000000..f0b23df --- /dev/null +++ b/manifests/conf/local.pp @@ -0,0 +1,19 @@ +define alternc::conf::local ( + $ensure = 'present', + $key = $name, + $value = '', + $match = undef, +) { + if !$match { + $_match = "${key}=.*" + } else { + $_match = $match + } + file_line { "${name}_local.sh_line": + ensure => $ensure, + path => '/etc/alternc/local.sh', + line => "${key}=${value}", + match => $_match, + require => Package['alternc'], + } +}