On Mon, May 19, 2014 at 4:29 PM, James Cammarata <
jcamm...@ansible.com> wrote:
> Ahh, if you're not wanting to completely bail out of the play entirely then
> you have a few options:
>
> 1) start using tags to label your tasks and use the --tags or --skip-tags
> options to control which parts are run/skipped.
This doesn't work since the rest of the play is conditional on
something that is dynamically discovered on the machine (let's say a
battery-backed cache or something like that). We don't know if
something is going to be skipped until the play has reached this
point.
> 2) move those tasks into a new file and use "include" with "when" to control
> when those tasks are run.
That has some promise. I'll report back after playing around.
> 3) split your playbook into roles (which can also use tags and when to
> conditionally control execution).
Not something that is known ahead of time and can change. The play
being executed is already in a role. Can a role conditionally include
another role while it's executing? Also seems clumsy to have a logical
role split into 2 separate roles. Makes having the logical 2nd half
share the vars/handlers/etc of the 1st half trickier.