On Sunday, January 4, 2015 2:08:15 PM UTC-5, Tom Bamford wrote:
>
> 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 }}
>
Tom,
Thanks for the suggestion. That did not seem to help. It is as if the
variable is not expanding.
ERROR: file could not read: /roles/postgres/tasks/{{ ansible_distribution
}}.yml
Tried:
ansible_os_family
ansible_distribution
id
Made copy of the file as Ubuntu.yml and Debian.yml.. in case any option
worked.
For now, until I can figure the include out, going with this:
- name: Handle install for Ubuntu
include: Ubuntu.yml
when: ansible_distribution == "Ubuntu"
That did not even produce output.. which was what I was hoping for.. so if
I can't figure out the include this would work.
Will very likely still want to figure it out; specially if I use
include_vars so likely will revisit this.
All the Galaxy roles I saw did Ubuntu or Centos. Want to do one for Ubuntu
and FreeBSD.. and later (as low priority) throw in Centos.
I use Ansible for my clients so I like the idea of something I can use for
most of my clients vs using one role per OS. Looked at existing roles in
galaxy and they were not quite what I needed. Plus figure would be a good
exercise for a first role for Galaxy.
--
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/d502c6fc-cf0b-4855-bdaa-5449c54f4608%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.