Replies: 1 comment
-
|
I don't think there is a way to do that with {% set master_files = salt['cp.list_master']('state/files/dir') %}
{% for path in master_files %}
{% if path.endswith('.j2') %}
render_{{ loop.index }}_{{ path|replace('/', '_')|replace('.', '_') }}:
file.managed:
- name: /tmp/dir/{{ path.rsplit('.j2', 1)[0].split('/')[-1] }}
- source: salt://{{ path }}
- template: jinja
- user: root
- group: root
- mode: 644
{% endif %}
{% endfor %} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
Imagine I have a source directory in my salt-master:
And I want to use
file.recursemodule, to copy the files recursively to thesalt://state/files/dirdirectory, copy it to/tmp/dirof my minion, and remove the.j2extension from those files, is this possible?The result I want in my minion:
Beta Was this translation helpful? Give feedback.
All reactions