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.

pirms 9 gadiem
pirms 9 gadiem
pirms 9 gadiem
pirms 9 gadiem
pirms 9 gadiem
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.enabled %}
  3. {%- if system.kernel is defined %}
  4. {%- if system.kernel.isolcpu is defined %}
  5. include:
  6. - linux.system.grub
  7. /etc/default/grub.d/90-isolcpu.cfg:
  8. file.managed:
  9. - contents: 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT isolcpus={{ system.kernel.isolcpu }}"'
  10. - require:
  11. - file: grub_d_directory
  12. {%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %}
  13. - watch_in:
  14. - cmd: grub_update
  15. {%- endif %}
  16. {%- endif %}
  17. {%- if system.kernel.version is defined %}
  18. linux_kernel_package:
  19. pkg.installed:
  20. - pkgs:
  21. - linux-image-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
  22. {%- if system.kernel.get('headers', False) %}
  23. - linux-headers-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
  24. {%- endif %}
  25. {%- if system.kernel.get('extra', False) %}
  26. - linux-image-extra-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
  27. {%- endif %}
  28. - refresh: true
  29. # Not very Salt-ish.. :-(
  30. linux_kernel_old_absent:
  31. cmd.wait:
  32. - 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 }}')"
  33. - watch:
  34. - pkg: linux_kernel_package
  35. {%- endif %}
  36. {%- for module in system.kernel.get('modules', []) %}
  37. linux_kernel_module_{{ module }}:
  38. kmod.present:
  39. - name: {{ module }}
  40. - persist: true
  41. {%- endfor %}
  42. {%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).iteritems() %}
  43. linux_kernel_{{ sysctl_name }}:
  44. sysctl.present:
  45. - name: {{ sysctl_name }}
  46. - value: {{ sysctl_value }}
  47. {%- endfor %}
  48. {%- endif %}
  49. {%- endif %}