use PVE::JSONSchema;
use PMG::Cluster;
+use PMG::Utils;
PMG::Config::Admin->register();
PMG::Config::Mail->register();
};
warn "parse http_proxy failed - $@" if $@;
}
+ $vars->{postgres}->{version} = PMG::Utils::get_pg_server_version();
return $vars;
}
sub rewrite_config_postgres {
my ($self) = @_;
- my $pgconfdir = "/etc/postgresql/11/main";
+ my $pg_maj_version = PMG::Utils::get_pg_server_version();
+ my $pgconfdir = "/etc/postgresql/$pg_maj_version/main";
my $changes = 0;
+[% TAGS <* *> -%]
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
-data_directory = '/var/lib/postgresql/11/main' # use data in another directory
+data_directory = '/var/lib/postgresql/<* postgres.version *>/main' # use data in another directory
# (change requires restart)
-hba_file = '/etc/postgresql/11/main/pg_hba.conf' # host-based authentication file
+hba_file = '/etc/postgresql/<* postgres.version *>/main/pg_hba.conf' # host-based authentication file
# (change requires restart)
-ident_file = '/etc/postgresql/11/main/pg_ident.conf' # ident configuration file
+ident_file = '/etc/postgresql/<* postgres.version *>/main/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/11-main.pid' # write an extra PID file
+external_pid_file = '/var/run/postgresql/<* postgres.version *>-main.pid' # write an extra PID file
# (change requires restart)
# - Process Title -
-cluster_name = '11/main' # added to process titles if nonempty
+cluster_name = '<* postgres.version *>/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
-stats_temp_directory = '/var/run/postgresql/11-main.pg_stat_tmp'
+stats_temp_directory = '/var/run/postgresql/<* postgres.version *>-main.pg_stat_tmp'
# - Statistics Monitoring -