Hi,
I started to refactor my play books to roles as described in
http://ansible.cc/docs/playbooks.html#roles.
If the task is in the role, the templates should be in the templates
directory. This is working, for example in this scenario:
- name: "[box_info] os production type identification"
tags: box_info
action: template src=box_info/box_info.j2 dest=/etc/box_info owner=root
group=root mode=0644
If I try to use file selector based on template as described on
http://ansible.cc/docs/playbooks2.html#selecting-files-and-templates-based-
on-variables
- name: "[ntp] setup ntp.conf"
action: template src=$item dest=/etc/ntp.conf backup=no owner=root
group=root mode=0644
first_available_file:
- ntp/ntp.conf.$ansible_fqdn.j2
- ntp/ntp.conf.$ansible_distribution.j2
- ntp/ntp.conf.default.j2
tags: ntp
notify:
- restart service ntp
I got error
TASK: [[ntp] setup ntp.conf]