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

39 行
1.0KB

  1. {% from "apt/map.jinja" import apt as apt_map with context %}
  2. {% set remove_apt_conf = salt['pillar.get']('apt:remove_apt_conf', apt_map.remove_apt_conf) %}
  3. {% set confd_dir = salt['pillar.get']('apt:confd_dir', apt_map.confd_dir) %}
  4. {% set clean_apt_conf_d = salt['pillar.get']('apt:clean_apt_conf_d', apt_map.clean_apt_conf_d) %}
  5. {% set apt_conf_d = salt['pillar.get']('apt:apt_conf_d', apt_map.apt_conf_d) %}
  6. /etc/apt/apt.conf:
  7. file.managed:
  8. - mode: '0644'
  9. - user: root
  10. - group: root
  11. {% if remove_apt_conf %}
  12. - contents: ''
  13. - contents_newline: False
  14. {% else %}
  15. - replace: False
  16. {% endif %}
  17. {{ confd_dir }}:
  18. file.directory:
  19. - mode: 755
  20. - user: root
  21. - group: root
  22. - clean: {{ clean_apt_conf_d }}
  23. {% for file, contents in apt_conf_d|dictsort %}
  24. {{ confd_dir }}/{{ file }}:
  25. file.managed:
  26. - source: salt://apt/templates/apt_conf.jinja
  27. - template: jinja
  28. - user: root
  29. - group: root
  30. - mode: 644
  31. - context:
  32. data: {{ contents }}
  33. - require_in:
  34. - file: {{ confd_dir }}
  35. {% endfor %}