Flush handlers with meta: flush_handlers before the task that requires it:
- name: change postgre pg_hba.conf
template: src=pg_hba.conf.j2 dest=/etc/postgresql/9.4/main/pg_hba.conf
notify: restart postgresql service
tags: pg_hba
- meta: flush_handlers
- name: set password for postgres
postgresql_user:
db: postgres
user: postgres
password: postgres