---- hosts: - all gather_facts: no vars: - my_list: [1,2,3,4] tasks: - name: TEMPLATE template: dest='/home/Ansible/dest.y' src='src.j2'failed: [HOST-A] => {"failed": true}msg: missing required arguments: dest
➜ Ansible cat test.yml---- hosts: localhost gather_facts: no vars: - my_list: [1,2,3,4] tasks: - name: TEMPLATE template: dest=/home/Ansible/dest.y src=src.j2➜ Ansible ansible-playbook test.yml
PLAY [localhost] **************************************************************
TASK: [TEMPLATE] **************************************************************failed: [localhost] => {"failed": true}msg: missing required arguments: dest
FATAL: all hosts have already failed -- aborting
PLAY RECAP ******************************************************************** to retry, use: --limit @/home/test.retry
localhost : ok=0 changed=0 unreachable=0 failed=1
- name: Copy ntp.conf from template
template: src=ntp.conf.j2 dest=/etc/ntp.conf
when: ansible_hostname != 'vmlog'
notify:
- restart ntp