Saltstack Official Apt Formula
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

preferences.sls 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {% from "apt/map.jinja" import apt as apt_map with context %}
  2. {% set apt = pillar.get('apt', {}) %}
  3. {% set remove_preferences = apt.get('remove_preferences', apt_map.remove_preferences) %}
  4. {% set clean_preferences_d = apt.get('clean_preferences_d', apt_map.clean_preferences_d) %}
  5. {% set preferences_dir = apt.get('preferences_dir', apt_map.preferences_dir) %}
  6. {% set preferences = apt.get('preferences', apt_map.preferences) %}
  7. {% set default_url = apt.get('default_url', apt_map.default_url) %}
  8. /etc/apt/preferences:
  9. file.managed:
  10. - mode: '0644'
  11. - user: root
  12. - group: root
  13. {% if remove_preferences %}
  14. - contents: ''
  15. - contents_newline: False
  16. {% else %}
  17. - replace: False
  18. {% endif %}
  19. {{ preferences_dir }}:
  20. file.directory:
  21. - mode: '0755'
  22. - user: root
  23. - group: root
  24. - clean: {{ clean_preferences_d }}
  25. {% for pref_file, args in preferences.items() %}
  26. {%- set p_package = args.package if args.package is defined else '*' %}
  27. {{ preferences_dir }}/{{ pref_file }}:
  28. file.managed:
  29. - mode: '0644'
  30. - user: root
  31. - group: root
  32. - contents:
  33. - "{{ 'Package: ' ~ p_package }}"
  34. - "{{ 'Pin: ' ~ args.pin }}"
  35. - "{{ 'Pin-Priority: ' ~ args.priority }}"
  36. {% if 'explanation' in args %}
  37. {% for explanation in args.explanation %}
  38. - "{{ 'Explanation: ' ~ explanation }}"
  39. {% endfor %}
  40. {% endif %}
  41. {% endfor %}