Saltstack Official Linux 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.

netconsole.sls 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {% from "linux/map.jinja" import system with context %}
  2. {% if system.enabled and system.netconsole is mapping and system.netconsole.enabled %}
  3. /etc/dhcp/dhclient-exit-hooks.d/netconsole:
  4. file.managed:
  5. - source: salt://linux/files/netconsole
  6. - makedirs: True
  7. /etc/network/if-up.d/netconsole:
  8. file.managed:
  9. - source: salt://linux/files/netconsole
  10. - mode: 755
  11. - makedirs: True
  12. /etc/network/if-down.d/netconsole:
  13. file.managed:
  14. - source: salt://linux/files/netconsole
  15. - mode: 755
  16. - makedirs: True
  17. /etc/default/netconsole.conf:
  18. file.managed:
  19. - source: salt://linux/files/netconsole.conf
  20. - template: jinja
  21. {% if system.netconsole is mapping and system.netconsole.target is mapping %}
  22. {% for target, data in system.netconsole.target.iteritems() %}
  23. {% if data is mapping and data.interface is defined %}
  24. /etc/network/if-up.d/netconsole {{ target }} {{ data.interface }}:
  25. cmd.run:
  26. - name: /etc/network/if-up.d/netconsole
  27. - env:
  28. - IFACE: {{ data.interface }}
  29. - METHOD: static
  30. - ADDRFAM: inet
  31. - MODE: start
  32. - onchanges:
  33. - file: /etc/default/netconsole.conf
  34. - require:
  35. - file: /etc/network/if-up.d/netconsole
  36. {% endif %}
  37. {% endfor %}
  38. {% endif %}
  39. {% endif %}