Saltstack Official Linux Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

44 lines
1.1KB

  1. {%- from "linux/map.jinja" import network with context %}
  2. {%- if network.enabled and grains.get('init', None) == 'systemd' %}
  3. {%- if network.systemd is mapping %}
  4. {%- for config_type, configs in network.systemd.items() %}
  5. {%- if config_type == 'link' %}
  6. /etc/udev/rules.d/80-net-setup-link.rules:
  7. file.managed:
  8. - makedirs: True
  9. - content: ""
  10. {%- endif %}
  11. {%- for config_name, config in configs.items() %}
  12. linux_network_systemd_networkd_{{ config_type }}_config_{{ config_name }}:
  13. file.managed:
  14. - name: /etc/systemd/network/{{ config_name }}.{{ config_type }}
  15. - source: salt://linux/files/systemd-network.conf
  16. - template: jinja
  17. - makedirs: True
  18. - defaults:
  19. settings: {{ config }}
  20. - watch_in:
  21. - module: linux_network_systemd_reload
  22. - module: linux_network_systemd_networkd
  23. {%- endfor %}
  24. {%- endfor %}
  25. linux_network_systemd_reload:
  26. module.wait:
  27. - name: service.systemctl_reload
  28. linux_network_systemd_networkd:
  29. service.running:
  30. - name: systemd-networkd
  31. - init_delay: 10
  32. - enable: True
  33. - reload: True
  34. - watch:
  35. - module: linux_network_systemd_reload
  36. {%- endif %}
  37. {%- endif %}