Ran across a situation where I needed to keep the files sync'd from my Salt Master to my Syndic. I searched online but couldn't really find any real solution other than the usual, "use a shared filesystem, rsync them over, etc).
Those solutions may be an option for others but for my environment, that would not work and needed a solution within Salt to do this.
After searching and testing, I modified the closest solution I was able to find and came up with the following that keeps /srv/salt sync'd on the Syndic to what's on the Master:
{% for file in salt['cp.list_master']() %}
/srv/salt/{{ file }}:
file.managed:
- name: /srv/salt/{{ file }}
- source: salt://{{ file }}
- user: salt
- group: salt
- mode: 640
- makedirs: True
{% endfor %}
Hope this helps others!
If you can set up the credentials, an rsync state will probably have better performance:
You might also consider a different fileserver backend that can be more easily shared.
Unfortunately, this doesn't work. It looks like a bug in the
sourceparser.