Ansible roles change workflow order by moving handlers.

0 votes
I want to change postgresql configuration file, restart service and then add db user. But the problem is my workflow does the same in a different order. Can I change it to the order I want bu moving the handlers?
Mar 12 in Ansible by Vijay
33 views

1 answer to this question.

0 votes

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
answered Mar 12 by William

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

Filter lists by attributes - Ansible

Filter the dicts using selectattr_filter in combination with ...READ MORE

answered Jan 14 in Ansible by Haider
38 views
0 votes
1 answer

Ansible playbook for moving files from one node to another remote node

The best way to do this is: copy ...READ MORE

answered Jan 16 in Ansible by Nigya

edited Jan 18 by Vardhan 959 views
0 votes
1 answer

Virtualization Infrastructure supported by Ansible

Yes, Vagrant supports Ansible, in-fact Ansible is ...READ MORE

answered Jan 25 in Ansible by Sai
21 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
152 views
0 votes
1 answer
0 votes
1 answer

Install multiple roles - Ansible

You'll need a requirements.yaml file which will ...READ MORE

answered Jan 9 in Ansible by Rishi
251 views
0 votes
1 answer

Install ansible galaxy roles

Here is a very basic example that ...READ MORE

answered Jan 9 in Ansible by Disha
62 views