You will need to handle failures and skipping on a per-task basis - that
logic does not exist at the role level.

As Karl noted, you should not use the fail module in this case. With
Ansible (and just about every other configuration management system out
there now), you define the state of the system as you want it to be, and
Ansible will make the changes required to bring your system to that state.
The fact that the software is already installed means your system is in the
state expected, which is not a failure.


On Wed, Sep 17, 2014 at 7:15 AM, P <[email protected]> wrote:

>
>
> On Wednesday, September 17, 2014 1:09:01 PM UTC+1, Karl Jorgensen wrote:
>>
>> Hi
>>
>> On Wed, Sep 17, 2014 at 01:22:51AM -0700, P wrote:
>> > Hi all,
>> >
>> > we have a playbook with several roles in it:
>> >   roles:
>> >   - role1
>> >   - role2
>> >   - role3
>> >   - role4
>> >   - role5
>> >   - roleX
>> > ...
>> >
>> > These roles install some software but each checks at the very begin if
>> the
>> > software is already installed
>> > and if it is - it aborts (using fail module). It turns out that i.e. if
>> the
>> > role3 fails (because its software is already installed)
>> > the whole playbook also failes (ansible 1.7.1).
>>
>> This is the expected behaviour.  A failure is a failure...
>>
>
> Why ?!?! I use fail module in a role so the role should fail and not the
> whole playbook.
>
>
>> > Is it possible to abort just particular role
>> > and let run the rest of the playbook ?
>>
>> I would recommend changing the roles so that installation of new
>> software is skipped (instead of failing) when the software is already
>> present...
>>
>
> What do you mean by "skipped"  ? If I check at the top of a role that the
> software is installed
> how can I skip the rest of role ?
>
>  --
> 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/4de3e97c-b389-4330-8e1d-54b7a9469cb1%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/4de3e97c-b389-4330-8e1d-54b7a9469cb1%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/CAMFyvFjsQUP7WHjKw9N1_xGMjcijXxmRiQdvBd%3D8MG3C64ekNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to