Ensure configuration of local.sh
This commit is contained in:
parent
dc107c2cac
commit
70608930b0
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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'],
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue