Hi Francisco

The {{ ansible_os_family }} fact is usually set to the parent (or other
ancestor) distribution. For Ubuntu it will be set to “Debian”. You might
want to use {{ ansible_distribution }} instead (or rename your included
file to Debian.yml - given that there is typically little to no difference
between them for most operations).

Regards
Tom
​

On 4 January 2015 at 07:19, Francisco Reyes <[email protected]> wrote:

> Was going over different posts on how to handle different OS within a role.
>
> In this thread:
> https://groups.google.com/forum/#!searchin/ansible-project/group_by$20role|sort:relevance|spell:false/ansible-project/OPCESPvMppg/5ueNHQf_oSAJ
>
> I see:
> >You can do things like
> >   - include: "{{ ansible_os_family }}.yml"
>
> Yet when I tried in a role I got:
> ERROR: file could not read: /roles/postgres/tasks/{{ ansible_os_family
> }}.yml
>
> If I hard code it like:
> - include: Ubuntu.yml
>
> it works.
>
> The calling playbook has
> gather_facts: True
>
> Any suggestions?
>
> ansible 1.9 (devel 3b80f63e22) last updated 2014/12/06 23:08:13 (GMT +000)
>   lib/ansible/modules/core: (detached HEAD b766390ae2) last updated
> 2014/12/06 23:08:14 (GMT +000)
>   lib/ansible/modules/extras: (detached HEAD 19e688b017) last updated
> 2014/12/06 23:08:16 (GMT +000)
>   v2/ansible/modules/core: (detached HEAD cb69744bce) last updated
> 2014/12/06 23:08:17 (GMT +000)
>   v2/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated
> 2014/12/06 23:08:19 (GMT +000)
>   configured module search path = /ansible/library:/usr/share/ansible/
>
> --
> 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/60336baa-441c-42dd-9800-114e99c9bfc2%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/60336baa-441c-42dd-9800-114e99c9bfc2%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/CAAnNz0Phqk9Y%2BLby5ijoOK4f_LYNva3futbp2GxgwTfyEKmo9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to