Saltstack Official Linux Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

44 lines
1.2KB

  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. /etc/network/if-down.d/netconsole:
  12. file.managed:
  13. - source: salt://linux/files/netconsole
  14. - mode: 755
  15. /etc/default/netconsole.conf:
  16. file.managed:
  17. - source: salt://linux/files/netconsole.conf
  18. - template: jinja
  19. {% if system.netconsole is mapping and system.netconsole.target is mapping %}
  20. {% for target, data in system.netconsole.target.iteritems() %}
  21. {% if data is mapping and data.interface is defined %}
  22. /etc/network/if-up.d/netconsole {{ target }} {{ data.interface }}:
  23. cmd.run:
  24. - name: /etc/network/if-up.d/netconsole
  25. - env:
  26. - IFACE: {{ data.interface }}
  27. - METHOD: static
  28. - ADDRFAM: inet
  29. - MODE: start
  30. - onchanges:
  31. - file: /etc/default/netconsole.conf
  32. - require:
  33. - file: /etc/network/if-up.d/netconsole
  34. {% endif %}
  35. {% endfor %}
  36. {% endif %}
  37. {% endif %}