Sorry Brian, My bad. It works with the "when" statement on the handler.
El lunes, 8 de junio de 2015, 10:46:21 (UTC+2), Dan C escribió: > > Thanks Brian, > > Is there a minimum version for the "when" statment to work with handlers? > The ansible version I am using for this test is 1.7.2 > > I have: > > # file: roles/beaver-configure/handlers/main.yml > - name: restart beaver > service: name=beaver.sh state=restarted > when: flag_not_restart is not defined > > # file: roles/beaver-configure/tasks/main.yml > - name: Copy conf beaver > template: src=../templates/conf.j2 dest=/etc/beaver/conf group=root > owner=root mode=0644 > notify: restart beaver > - name: Start a enable beaver > service: name=beaver.sh enabled=yes state=started > > > I call an ansible playbook which calls the beaver role with: > /usr/local/bin/ansible-playbook /tmp/ansible-local/php.yml --extra-vars > 'flag_not_restart=1' -c local -i /tmp/ansible-local/localhost.inv > > If I debug the "flag_not_restart" I can see it exist and is "1". > And yet the "restart beaver" handler is called and executed. > > So, am I doing something wrong? > > > El domingo, 7 de junio de 2015, 23:47:35 (UTC+2), Brian Coca escribió: >> >> handlers are not affected by tags in general, but they should be >> affected by when: >> >> -- >> Brian Coca >> > -- 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/263286f4-8c59-41ef-a608-98f77e096fe6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
