From 2e16b44b24e2f1626cedb00c94aad9b2a1a8c4d4 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 25 Dec 2015 22:17:01 -0800 Subject: [PATCH] puppet: Use $postgres_version in postgres template. This eliminates hardcoding of the postgres version from the Zulip puppet configuration. --- puppet/zulip/manifests/postgres_appdb_tuned.pp | 2 +- .../postgresql/postgresql.conf.template.erb} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename puppet/zulip/{files/postgresql/postgresql.conf.template => templates/postgresql/postgresql.conf.template.erb} (97%) diff --git a/puppet/zulip/manifests/postgres_appdb_tuned.pp b/puppet/zulip/manifests/postgres_appdb_tuned.pp index ee1d1c0dd6..c991f5d1bd 100644 --- a/puppet/zulip/manifests/postgres_appdb_tuned.pp +++ b/puppet/zulip/manifests/postgres_appdb_tuned.pp @@ -9,7 +9,7 @@ class zulip::postgres_appdb_tuned { owner => "postgres", group => "postgres", mode => 644, - source => "puppet:///modules/zulip/postgresql/postgresql.conf.template" + content => template("zulip/postgresql/postgresql.conf.template.erb"), } # We can't use the built-in $memorysize fact because it's a string with human-readable units diff --git a/puppet/zulip/files/postgresql/postgresql.conf.template b/puppet/zulip/templates/postgresql/postgresql.conf.template.erb similarity index 97% rename from puppet/zulip/files/postgresql/postgresql.conf.template rename to puppet/zulip/templates/postgresql/postgresql.conf.template.erb index c0c5e8fe94..531461c1f1 100644 --- a/puppet/zulip/files/postgresql/postgresql.conf.template +++ b/puppet/zulip/templates/postgresql/postgresql.conf.template.erb @@ -38,15 +38,15 @@ # 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/9.3/main' # use data in another directory +data_directory = '/var/lib/postgresql/<%= scope["zulip::base::postgres_version"] %>/main' # use data in another directory # (change requires restart) -hba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based authentication file +hba_file = '/etc/postgresql/<%= scope["zulip::base::postgres_version"] %>/main/pg_hba.conf' # host-based authentication file # (change requires restart) -ident_file = '/etc/postgresql/9.3/main/pg_ident.conf' # ident configuration file +ident_file = '/etc/postgresql/<%= scope["zulip::base::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/9.3-main.pid' # write an extra PID file +external_pid_file = '/var/run/postgresql/<%= scope["zulip::base::postgres_version"] %>-main.pid' # write an extra PID file # (change requires restart)