This is an automated email from the ASF dual-hosted git repository.

jhg03a pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new a5a3ea7  postgresql.conf update to account for changes in postgres13+ 
(#5671)
a5a3ea7 is described below

commit a5a3ea71bb5aa9b2c4c5d2f428b445ab34ae3b11
Author: Ashish P <[email protected]>
AuthorDate: Thu Mar 25 10:06:45 2021 -0600

    postgresql.conf update to account for changes in postgres13+ (#5671)
    
    * postgresql.conf update to account for changes in postgres13+
    
    * updating postgresql service name to match passed postgresql verision
    
    * updating easy_install to pip
---
 infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml      | 2 +-
 .../ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml           | 2 +-
 .../ansible/roles/traffic_opsdb/templates/postgresql.conf.j2      | 8 +++++++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml 
b/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml
index afe019a..36d310d 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/handlers/main.yml
@@ -14,7 +14,7 @@
 #
 - name: Restart Traffic OpsDB
   systemd:
-    name: postgresql-9.6
+    name: "{{ pg_service_name }}"
     state: restarted
     daemon_reload: yes
   notify: Wait for TODB to become available
diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml 
b/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml
index 9c7fec3..1cf2730 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml
+++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml
@@ -65,7 +65,7 @@
     content: PATH=$PATH:{{ pg_bin_path }}
 
 - name: Install psycopg2 python module
-  easy_install:
+  pip:
     name: psycopg2
   environment:
     PATH: "{{ pg_bin_path }}:{{ lookup('env', 'PATH') }}"
diff --git 
a/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2 
b/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2
index 73a1987..04ea289 100644
--- a/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2
+++ b/infrastructure/ansible/roles/traffic_opsdb/templates/postgresql.conf.j2
@@ -255,7 +255,13 @@ archive_mode = off               # enables archiving; off, 
on, or always
 
 max_wal_senders = 10           # max number of walsender processes
                                # (change requires restart)
-wal_keep_segments = 32         # in logfile segments, 16MB each; 0 disables
+
+{% if (pg_major_version) | int <= 12 %}
+wal_keep_segments = 32 # in logfile segments, 16MB each; 0 disables
+{% else %}
+wal_keep_size = 512
+{% endif %}
+
 #wal_sender_timeout = 60s      # in milliseconds; 0 disables
 
 #max_replication_slots = 0     # max number of replication slots

Reply via email to