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

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
    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
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 367 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
+13 votes
2 answers
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
0 votes
1 answer

Install ansible galaxy roles

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

answered Jan 9 in Ansible by Disha

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.