- name: install postgres apt: pkg: postgresql - name: generate pg_hba template: src: pg_hba.conf.j2 dest: /etc/postgresql/9.6/main/pg_hba.conf owner: postgres group: postgres mode: 0640 notify: - restart postgres