Skip to content

Instantly share code, notes, and snippets.

Created October 21, 2016 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5ddd4125106f3840c93d519a31605af9 to your computer and use it in GitHub Desktop.
Save anonymous/5ddd4125106f3840c93d519a31605af9 to your computer and use it in GitHub Desktop.
{% set data = salt.pillar.get('data') %}
{% set caller = salt.pillar.get('caller') %}
{% for dir in data.filer_dirs %}
shared_folder_{{ dir }}:
salt.state:
- tgt: filer1.prod.lan
- sls: filer.create_shared_dir
- pillar:
dir: {{ dir }}
user: {{ data.user }}
group: {{ data.group }}
{% endfor %}
{% for src, path in data.symlink.items() %}
create_symlinks_{{ src }}:
salt.function:
- name: file.symlink
- tgt: {{ caller }}
- arg:
- {{ src }}
- {{ path }}
- require:
{% for dir in data.filer_dirs %}
- salt: shared_folder_{{ dir }}
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment