Saltstack Official Linux Formula
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

46 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. - 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.items() %}
  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 %}