Seems like something in your workflow is odd -- can you describe more
specifically what you are trying to do?

Based on what you said, I think this might work:

Maybe in your playbook could have a pre-task set a fact --  something like:

pre_tasks:
  - name: "Set role change"
    set_fact: role_change="no"

That should run before all the other roles are run.

Your role tasks would send a notify to a common handler that would

-  name: "Set role change"
    set_fact: role_change="yes"

then in your playbook have a task that gets executed after your roles:

- name: do this task when roles change
  command: foo bar
  when: role_change == "yes"

- James

On Thu, Dec 5, 2013 at 1:35 PM, senorsmile <[email protected]> wrote:
> After trying to implement this workaround, I realize that this does NOT fix
> my issue.  I need to have a single task run at the very end, if any of other
> multiple roles have change.
>
> Currently, I must duplicate the handler into the multiple roles, which means
> the handler gets run multiple times if multiple roles have changes.  I need
> it to only run once at the very end.
>
> Still searching for solution to OP...
>
>
> On Wednesday, December 4, 2013 2:44:40 PM UTC-8, senorsmile wrote:
>>
>> I have been thinking about this all wrong.  I just need to set up a
>> handler that includes the yml for the role I want, and put a notify on the
>> tasks of the other role.
>>
>> If anyone has a better (more direct way from site.yml), feel free to post.
>>
>>
>> On Wednesday, December 4, 2013 2:26:22 PM UTC-8, senorsmile wrote:
>>>
>>> I'm trying to come up with a seemingly simple logic, yet can't figure out
>>> how to do it in ansible:
>>>
>>> I want to run the last role only if any previous roles have changes.
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to