I'd say use tags. That's what they are for. You could also
divide your roles up, so instead of 2 roles, you have four.
A/
config/
tasks/main.yml
install/
tasks/main.yml
B/
config/
tasks/main.yml
install/
tasks/main.yml
install.yml:
- hosts: Ahosts
roles:
- role: A/install
- hosts: Bhosts
roles:
- role: B/install
config.yml:
- hosts: Ahosts
roles:
- role: A/config
- hosts: Bhosts
roles:
- role: B/config
- James
On Wed, Dec 11, 2013 at 9:21 PM, Dmitry Makovey <[email protected]> wrote:
> Hi,
>
> I have a usecase for split-playbook but I still want to maintain it all
> under the same structure. In my case I'd like to split two phases "install"
> and "configure" but retain most of the vars etc. between two.
>
> What I was thinking is having something like:
>
> install.yml
> config.yml
> roles
> \_A
> \_tasks
> \_install.yml
> \_conig.yml
> \_B
> \_tasks
> \_install.yml
> \_config.yml
>
>
> with install/config.yml looking something like:
>
> - hosts: Ahosts
> roles:
> - role: A
>
> - hosts: Bhosts
> roles:
> - role: B
>
> so when I call ansible-playbook install.yml it will invoke install.yml for
> each role (instead of main.yml) and the same for "config.yml".
>
> I realize that something similar could be done with tags but resulting
> constructs become bit cumbersome IMO and one has to remember to use tags-
> otherwise entire execution will go in one sweep.
>
> So in other words can I redefine what to call instead of main.yml for all
> roles at runtime?
>
>
> --
> 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.