Saltstack Official Linux Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. - replace: {{ file.get('replace', 'True') }}
  40. - user: {{ file.get('user', 'root') }}
  41. - group: {{ file.get('group', 'root') }}
  42. {%- if file.mode is defined %}
  43. - mode: {{ file.mode }}
  44. {%- endif %}
  45. {%- if file.dir_mode is defined %}
  46. - dir_mode: {{ file.dir_mode }}
  47. {%- endif %}
  48. {%- if file.encoding is defined %}
  49. - encoding: {{ file.encoding }}
  50. {%- endif %}
  51. {%- endfor %}
  52. {%- endif %}