diff --git a/zabbix-frontend/tasks/main.yml b/zabbix-frontend/tasks/main.yml
index e495428f210cb02117ecef17106beed6292eed44..d518ae003db1d3c31981cfd39cf18dc7ecbf8dba 100644
--- a/zabbix-frontend/tasks/main.yml
+++ b/zabbix-frontend/tasks/main.yml
@@ -82,7 +82,7 @@
     - zabbix
 
 - name: ensure the database server listens on the external interface
-  replace: dest=/etc/postgresql/9.4/main/postgresql.conf regexp="#listen_addresses = 'localhost'" replace="listen_addresses = '*'"
+  replace: dest=/etc/postgresql/9.6/main/postgresql.conf regexp="#listen_addresses = 'localhost'" replace="listen_addresses = '*'"
   notify:
     - restart postgres
   delegate_to: "{{ zabbix_db_host }}"
@@ -91,7 +91,7 @@
     - zabbix
 
 - name: ensure the database server allows connections from the server
-  lineinfile: dest=/etc/postgresql/9.4/main/pg_hba.conf insertafter="host    all             all             127.0.0.1/32            md5" line="host    {{ zabbix_db_name }}          {{ zabbix_db_user }}          {{ ansible_fqdn }} md5" state=present
+  lineinfile: dest=/etc/postgresql/9.6/main/pg_hba.conf insertafter="host    all             all             127.0.0.1/32            md5" line="host    {{ zabbix_db_name }}          {{ zabbix_db_user }}          {{ ansible_fqdn }} md5" state=present
   notify:
     - restart postgres
   delegate_to: "{{ zabbix_db_host }}"
diff --git a/zabbix-server/tasks/main.yml b/zabbix-server/tasks/main.yml
index 7be21c4163cb681e40592c23239b7d7d90238b11..5ad75e95b45def291e747ff50d7ee8e1e5078c75 100644
--- a/zabbix-server/tasks/main.yml
+++ b/zabbix-server/tasks/main.yml
@@ -71,7 +71,7 @@
     - zabbix
 
 - name: ensure the database server listens on the external interface
-  replace: dest=/etc/postgresql/9.4/main/postgresql.conf regexp="#listen_addresses = 'localhost'" replace="listen_addresses = '*'"
+  replace: dest=/etc/postgresql/9.6/main/postgresql.conf regexp="#listen_addresses = 'localhost'" replace="listen_addresses = '*'"
   notify:
     - restart postgres
   delegate_to: "{{ zabbix_db_host }}"
@@ -80,7 +80,7 @@
     - zabbix
 
 - name: ensure the database server allows connections from the server
-  lineinfile: dest=/etc/postgresql/9.4/main/pg_hba.conf insertafter="host    all             all             127.0.0.1/32            md5" line="host    {{ zabbix_db_name }}          {{ zabbix_db_user }}          {{ ansible_fqdn }} md5" state=present
+  lineinfile: dest=/etc/postgresql/9.6/main/pg_hba.conf insertafter="host    all             all             127.0.0.1/32            md5" line="host    {{ zabbix_db_name }}          {{ zabbix_db_user }}          {{ ansible_fqdn }} md5" state=present
   notify:
     - restart postgres
   delegate_to: "{{ zabbix_db_host }}"