Saltstack Official Linux Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

openvswitch.sls 943B

12345678910111213141516171819202122232425262728293031323334353637
  1. {%- from "linux/map.jinja" import network with context %}
  2. {%- if network.get('openvswitch', {}).get('enabled', False) %}
  3. openvswitch_pkgs:
  4. pkg.installed:
  5. - pkgs: {{ network.ovs_pkgs }}
  6. /etc/default/openvswitch-switch:
  7. file.managed:
  8. - source: salt://linux/files/openvswitch-switch.default
  9. - template: jinja
  10. - require:
  11. - pkg: openvswitch_pkgs
  12. /etc/systemd/system/openvswitch-switch.service:
  13. file.managed:
  14. - source: salt://linux/files/openvswitch-switch.systemd
  15. - template: jinja
  16. - require:
  17. - pkg: openvswitch_pkgs
  18. module.run:
  19. - name: service.systemctl_reload
  20. - onchanges:
  21. - file: /etc/systemd/system/openvswitch-switch.service
  22. openvswitch_switch_service:
  23. service.running:
  24. - name: openvswitch-switch
  25. - enable: true
  26. {%- if grains.get('noservices') %}
  27. - onlyif: /bin/false
  28. {%- endif %}
  29. - watch:
  30. - file: /etc/default/openvswitch-switch
  31. {%- endif %}