Saltstack Official Linux Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

41 rinda
1.2KB

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.enabled %}
  3. {%- if system.kernel is defined %}
  4. {%- if system.kernel.version is defined %}
  5. linux_kernel_package:
  6. pkg.installed:
  7. - names:
  8. - linux-image-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
  9. {%- if system.kernel.get('headers', False) %}
  10. - linux-headers-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
  11. {%- endif %}
  12. {%- if system.kernel.get('extra', False) %}
  13. - linux-image-extra-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
  14. {%- endif %}
  15. - refresh: true
  16. # Not very Salt-ish.. :-(
  17. linux_kernel_old_absent:
  18. cmd.wait:
  19. - name: "apt-get purge -y $(dpkg -l '*linux-image-[0-9]*' '*linux-headers-[0-9]*' '*linux-image-extra-[0-9]*' | grep -E '^ii' | awk '{print $2}' | grep -v '{{ system.kernel.version }}')"
  20. - watch:
  21. - pkg: linux_kernel_package
  22. {%- endif %}
  23. {%- for sysclt_name, sysctl_value in system.kernel.get('sysctl', {}).iteritems() %}
  24. linux_kernel_{{ sysclt_name }}:
  25. sysctl.present:
  26. - name: {{ sysclt_name }}
  27. - value: {{ sysctl_value }}
  28. {%- endfor %}
  29. {%- endif %}
  30. {%- endif %}