+# postrgesql for kivi
+- name: Remove existing rules to ensure correct ordering of the rules
+ ansible.builtin.postgresql_pg_hba:
+ dest: /etc/postgresql/17/main/pg_hba.conf
+ overwrite: true
+ contype: local
+ users: all
+ databases: all
+ method: peer
+
+- name: Allow access from localhost to Postgresql.
+ ansible.builtin.postgresql_pg_hba:
+ dest: /etc/postgresql/17/main/pg_hba.conf
+ contype: host
+ users: postgres
+ databases: all
+ address: 127.0.0.1/32
+ method: trust
+ notify: Restart postgresql
+
+# apache server for kivi
+- name: Activate apache fastcgi, headers and ssl modules.
+ community.general.apache2_module:
+ state: present
+ name: "{{ item }}"
+ loop:
+ - fcgid
+ - headers
+ - ssl
+ - rewrite
+ - socache_shmcb
+# notify: Enable SSL