Here's an example of the scenario I am describing:

- handlers:
  -name: restart apache
  -service: apache state=restarted
 
- tasks:
  - name: enable apache proxy module  [A]
    command; a2enmod proxy creates=/etc/apache/mods-ehabled/proxy.load
    notify: restart apache

  - name: task that may fail [B]
    command: this_may_fail


On this first run apache gets reconfigured, task B fails so apache doesn't 
get restarted. On the second run, the first task is skipped, task B 
completes successfully, and apache does not get restarted and ends up 
running the original configuration.


On Friday, February 7, 2014 12:25:32 PM UTC-8, Walid Shaari wrote:
>
> can you share your playbook, it is not clear the line of dependencies 
> between A, B, and template file  
>
>
> On 7 February 2014 20:51, Nadav Samet <[email protected] <javascript:>>wrote:
>
>> Hey,
>>
>> I have a play where I make edits to apache configs which includes a 
>> notify "restart apache". That all works well, except in the following 
>> scenario:
>>
>> 1. Task A changes apache configs. Task B runs after task A fails and the 
>> play aborts. Apache still runs the old version of the config file.
>>
>> 2. I re-run the playbook, now task A skips since there's nothing to 
>> change and Apache does not get restarted. The play finishes successfully 
>> but Apache never got restarted.
>>
>> One path to go is to immediately restart apache, but that would lead to 
>> multiple restarts per run. Any ideas?
>>
>> -Nadav
>>  
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> 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].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to