Hi,

I am runnig a playbook in check mode (--check --diff) to verify which 
changes are going to be applied in a service config file.
The problem is that the dry run thinks the change is applied and fires the 
notify handler, restarting the service with no change applied

On a production enviroment that can be catastrofical

¿ is there any way to avoid the handler on dry run mode ?

Example code:

task/main.yml
...
- name: configure elasticsearch
  template: src={{ item[1:] }}.j2 dest={{ item }}
            owner=root group=root mode=0644
  with_items:
    - '/etc/default/elasticsearch'
    - '{{ elasticsearch_path_conf }}/elasticsearch.yml'
    - '{{ elasticsearch_path_conf }}/logging.yml'
  notify:
    - restart elasticsearch
  tags:
    - configure
...

handlers/main.yml
...
- name: restart elasticsearch
  service: >
    name=elasticsearch
    state=restarted
    enabled=yes
...

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/768bb8f0-e11a-435c-ba41-d3490c3816c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to