template - Templates a file out to a remote server. — Ansible Documentation
copy - Copies files to remote locations. — Ansible Documentation
- key valueでsrcとdestを書き換えるやつ
- name: template everything for fooserv template: src={{item.0}} dest={{item.1}} with_items: - [ 'templates/foo.j2', '/etc/splat/foo.conf' ] - [ 'templates/bar.j2', '/etc/splat/bar.conf' ] notify: - restart fooserv
- そのまんまコピーするやつ
- name: template everything for fooserv template: src={{item}} dest={{item}} with_items: - [ 'templates/foo.conf' ] - [ 'templates/bar.conf' ] notify: - restart fooserv