Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 line
1.2KB

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.enabled %}
  3. {%- for file_name, file in system.file.items() %}
  4. linux_file_{{ file_name }}:
  5. file.managed:
  6. {%- if file.name is defined %}
  7. - name: {{ file.name }}
  8. {%- else %}
  9. - name: {{ file_name }}
  10. {%- endif %}
  11. {%- if file.source is defined %}
  12. - source: {{ file.source }}
  13. {%- if file.hash is defined %}
  14. - source_hash: {{ file.hash }}
  15. {%- else %}
  16. - skip_verify: True
  17. {%- endif %}
  18. {%- elif file.contents is defined %}
  19. - contents: {{ file.contents|yaml }}
  20. {%- elif file.contents_pillar is defined %}
  21. - contents_pillar: {{ file.contents_pillar }}
  22. {%- elif file.contents_grains is defined %}
  23. - contents_grains: {{ file.contents_grains }}
  24. {%- endif %}
  25. - makedirs: {{ file.get('makedirs', 'True') }}
  26. - user: {{ file.get('user', 'root') }}
  27. - group: {{ file.get('group', 'root') }}
  28. {%- if file.mode is defined %}
  29. - mode: {{ file.mode }}
  30. {%- endif %}
  31. {%- if file.dir_mode is defined %}
  32. - dir_mode: {{ file.dir_mode }}
  33. {%- endif %}
  34. {%- if file.encoding is defined %}
  35. - encoding: {{ file.encoding }}
  36. {%- endif %}
  37. {%- endfor %}
  38. {%- endif %}