Skip to content

Instantly share code, notes, and snippets.

@halberom
Last active October 9, 2021 04:07
Show Gist options
  • Save halberom/02713ec52a37eb564028 to your computer and use it in GitHub Desktop.
Save halberom/02713ec52a37eb564028 to your computer and use it in GitHub Desktop.
ansible - example of template module and multiple files
---
- hosts: foo
tasks:
- name: register templates
local_action: shell ls {{ inventory_dir }}/path/to/templates
register: template_files
- template: src={{ item }} dest=/etc/httpd/conf.d/{{item}}
with_items: template_files.stdout_lines
@tehfink
Copy link

tehfink commented Jul 30, 2017

I had to do "{{ template_files.stdout_lines }}" to make it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment