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.

57 lines
1.6KB

  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. {%- if file.serialize is defined %}
  6. file.serialize:
  7. - formatter: {{ file.serialize }}
  8. {%- if file.contents is defined %}
  9. - dataset: {{ file.contents|json }}
  10. {%- elif file.contents_pillar is defined %}
  11. - dataset_pillar: {{ file.contents_pillar }}
  12. {%- endif %}
  13. {%- else %}
  14. file.managed:
  15. {%- if file.source is defined %}
  16. - source: {{ file.source }}
  17. {%- if file.hash is defined %}
  18. - source_hash: {{ file.hash }}
  19. {%- else %}
  20. - skip_verify: True
  21. {%- endif %}
  22. {%- if file.template is defined %}
  23. - template: {{ file.template }}
  24. {%- endif %}
  25. {%- elif file.contents is defined %}
  26. - contents: {{ file.contents|json }}
  27. {%- elif file.contents_pillar is defined %}
  28. - contents_pillar: {{ file.contents_pillar }}
  29. {%- elif file.contents_grains is defined %}
  30. - contents_grains: {{ file.contents_grains }}
  31. {%- endif %}
  32. {%- endif %}
  33. {%- if file.name is defined %}
  34. - name: {{ file.name }}
  35. {%- else %}
  36. - name: {{ file_name }}
  37. {%- endif %}
  38. - makedirs: {{ file.get('makedirs', 'True') }}
  39. - user: {{ file.get('user', 'root') }}
  40. - group: {{ file.get('group', 'root') }}
  41. {%- if file.mode is defined %}
  42. - mode: {{ file.mode }}
  43. {%- endif %}
  44. {%- if file.dir_mode is defined %}
  45. - dir_mode: {{ file.dir_mode }}
  46. {%- endif %}
  47. {%- if file.encoding is defined %}
  48. - encoding: {{ file.encoding }}
  49. {%- endif %}
  50. {%- endfor %}
  51. {%- endif %}