Using variables from a notifying task in a handler

51 views
Skip to first unread message

Peter Murray

unread,
Jun 18, 2014, 4:08:03 PM6/18/14
to ansible...@googlegroups.com
I have a task that iterates over a dictionary of directory names to remove a file:

- name: Remove conflicting XACML policy
  file: path=/opt/fedora/{{ item.key }}/data/blah.xml
        state=absent
  with_dict: installs
  notify: Reload XACML

If the file is removed, a handler is required to restart a process to re-read the directory of policies.  I'd like to do something like this:

- name: Reload XACML
  shell: fedora-reload-policies.sh
         chdir=/opt/fedora/{{ item.key }}/server/bin
          
But what I get is an undefined-variable error:

NOTIFIED: [fedora-sites | Reload XACML] ***************************************
<10.11.12.16> ESTABLISH CONNECTION FOR USER: vagrant
fatal: [10.11.12.16] => One or more undefined variables: 'item' is undefined

FATAL: all hosts have already failed -- aborting

 Is what I'm trying to do possible?


Peter
-- 
Peter Murray
Assistant Director, Technology Services Development
LYRASIS
Peter....@lyrasis.org
+1 678-235-2955
800.999.8558 x2955


Michael DeHaan

unread,
Jun 19, 2014, 5:23:11 PM6/19/14
to ansible...@googlegroups.com
This is unfortunately not possible.





--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5eec5fe1-d66c-4146-b8fe-524fb46b992d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages