Created
November 22, 2016 12:47
-
-
Save eagleusb/c3b0a6584e4545fc512c2f492db7d601 to your computer and use it in GitHub Desktop.
Ansible template loop snippet
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
- name: Copying the templated jinja2 files | |
template: | |
src: {{item}} | |
dest: {{RUN_TIME}}/{{ item | regex_replace(role_path+'/templates','') | regex_replace('\.j2', '') }} | |
with_items: | |
- "{{ lookup('pipe','find {{role_path}}/templates -type f').split('\n') }}" | |
- name: create x template | |
template: | |
src: {{ item }} | |
dest: /tmp/{{ item | basename | regex_replace('\.j2','') }} | |
with_fileglob: | |
- ../templates/*.j2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment