Seperate roles for every flavor are exactly what I wan't to avoid. We 
usually have different roles for different ansible_os_families but 
sometimes this is not granular enough.

We have the power to make decisions based on facts at runtime
  action: template src=apache2.conf.j2-{{ ansible_lsb.codename }} dest={{ 
apache_ConfigBase }}/apache2.conf
to create smart roles that don't need repeated tasks with when statements 
 for every flavor

But there is no smart way to decide which tasks to run based on facts - 
just because the YAML syntax checker raises an error because a variable is 
not defined (yet) and thus a play that is perfectly valid at runtime is 
considered faulty :-( At least it would be great if that was configurable 
(fail/warn/ignore)

With the conditional includes we have a workaound for this shortcomming, so 
that we can reduce the conditionals to one per flavor. This is not great 
but sufficient - but as ansible is a great tool it is less than I expected 
;-)

thanks,
Oliver








 








Am Freitag, 13. Juni 2014 04:37:12 UTC+2 schrieb Michael DeHaan:
>
> You can use "group_by" to avoid repeated conditionals.
>
> Select the hosts where something is true and apply roles/tasks to the 
> dynamically created group.
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8e933e04-73d6-4b53-bd27-1500ba4cb9c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to