Seth Vidal provided a very nice patch that allows us to conditionally
pick a different source for a file based on an ansible, facter, or
ohai fact. This is admittedly an advanced sort of thing, but I think
it'll be pretty clear and I'm quite impressed by the syntax.
This can be used, for instance, to use the same playbook for different
operating systems, where depending on the operating system you need a
different configuration file.
I've included an example of what this looks like in a playbook here:
https://github.com/ansible/ansible/blob/devel/examples/playbooks/selective_file_sources.yml
I'll note that that presently the best OS variable we have is
ansible_distribution_version, which gives 6.2 for CentOS, so making a
fact that includes the integer version is probably in order. Let me
know if there are other facts you would like to use for conditionally
chosing a template or copy file location.
This could also be used for the ability to optionally be able to
override a file based on it's hostname, and then default to a value if
there is no hostname specific configuration file.
I'm keeping all the documentation for 0.4 off the site until 0.4 goes
out, so see the playbook example for now for how it works.
Enjoy shiny new features!
--Michael