Last active
October 9, 2021 04:07
-
-
Save halberom/02713ec52a37eb564028 to your computer and use it in GitHub Desktop.
ansible - example of template module and multiple files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had to do
"{{ template_files.stdout_lines }}"
to make it work