On Monday, June 2, 2014 9:38:45 PM UTC-7, David Carmean wrote:
>
>
> In my mind, any particular role that a server may fill (and it may fill 
> more than one), in turn requires one or more "features" or "feature-sets" 
> in order to be able to fulfill that role.  In other words, I think of a 
> heirarchy that looks like this;
>
> * appstack_X
> ** server_n
> *** role_a 
> **** feature_A
> **** feature_E
> **** feature_O
> *** role_b
> **** feature_A
> **** feature_B
> **** feature_G
>
> Anyone else gone through this thought process,or organize their configs 
> like this?
>
>
Yes and no...


In the case above I would consider that feature_A is a separate role but is 
a dependency of role_a and role_b...  

In my case I have a "common" role that performs a number of trivial tasks. 
 Each task is a separate, distinct, task so it has it's own file in 
role/common/tasks/...  The main.yml includes all of those tasks within that 
role, but order in this case is irrelevant.

So for your example I would have the following structure...

role/role_a/tasks/
                     feature_E
                     feature_O
role/role_b/tasks/
                     feature_B
                     feature_G
role/feature_a/tasks/
                     feature_A

and then in both role/role_a/meta and role/role_b/meta you would have a 
main.yml that had 
dependencies: 
  - {feature_a}

If you later added a role_c using features C, D and F it would not include 
a dependency for feature_a...  I would still have a separate main.yml in 
role/feature_a/tasks (although I would not use that name) in case I ever 
wanted to add an additional task to that feature.  That way I can write the 
new task and then modify the main.yml.

I hope that this helps,

   Adan

-- 
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/793a7241-8875-49fc-b3c6-b03b007a2b37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to