I cannot find documentation needed to clean up before upgrading to 1.6. Searching 'first_available_file' on
http://docs.ansible.com, shows 4 results, but the pages themselves do not contain the search term.
PROBLEM: In the playbook below, Ansible 1.4.5 shows 'DEPRECATION WARNING' when I use $item, and 'undefined variables' when in use {{item}}.
- name: build and write /etc/hosts file
action: template src=templates/$item dest=/etc/hosts owner=root group=root mode=0644
first_available_file:
- templates/etc-hosts.{{ansible_hostname}}.j2
- templates/etc-hosts.j2
[DEPRECATION WARNING]: Legacy variable substitution, such as using ${foo} or
$foo instead of {{ foo }} is currently valid but will be phased out and has
been out of favor since version 1.2. This is the last of legacy features on our
deprecation list. You may continue to use this if you have specific needs for
now. This feature will be removed in version 1.6. Deprecation warnings can be
disabled by setting deprecation_warnings=False in ansible.cfg.
How do I refactor this?