Hi Paul, The way notify works is if any of the tasks is changed (when looping) it will fire the notify.
It does not fire per task. On Wed, Sep 24, 2014 at 4:57 PM, Paul Wolstenholme <[email protected] > wrote: > I'm using the template module and would like loop through a bunch of > templates for configuration files and execute and handler if need be. I > tried the following. And, it failed. I thought it would be cool to avoid > descrete template plays for each service. > > - name: Push NRPE configuration files > template: > src={{item.j2}} > dest={{item.dest}} > mode={{item.mode}} > backup=yes > register: nrpe > notify: {{item.handler}} > with_items: > - { j2: "smartos_setup.sh.j2", dest: > "{{smartos_custom}}/share/svc/smartos_setup.sh", mode: '0755', handler: > 'setup-reload' } > - { j2: "nrpe.cfg.j2", dest: "{{smartos_custom}}/etc/nrpe.cfg", mode: > '0644', handler: 'nrpe-reload' } > tags: smartos_global > > Result: > > ok: [smartos01] => (item={'dest': u'/opt/custom/smf/nrpe/manifest.xml', > 'handler': 'nrpe-reload', 'mode': '0644', 'j2': 'nrpe-manifest.xml.j2'}) > changed: [smartos01] => (item={'dest': u'/opt/custom/etc/nrpe.cfg', > 'handler': 'nrpe-reload', 'mode': '0644', 'j2': 'nrpe.cfg.j2'}) > ERROR: change handler ({{ item.handler }}) is not defined > > -- > 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/de933ec7-bc71-4e56-b3db-55cf85a43409%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/de933ec7-bc71-4e56-b3db-55cf85a43409%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CA%2BnsWgy-6VjdgBPdCyo8rcmsAXTTSoWazE2ST9xpa7FJ%2BM5oNQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
