Oleh Hryhorov | 18a7077 | 2018-05-16 14:45:58 +0000 | [diff] [blame] | 1 | {%- from "linux/map.jinja" import network with context %} |
| 2 | |
| 3 | {%- if network.get('openvswitch', {}).get('enabled', False) %} |
| 4 | |
| 5 | openvswitch_pkgs: |
| 6 | pkg.installed: |
| 7 | - pkgs: {{ network.ovs_pkgs }} |
| 8 | |
| 9 | /etc/default/openvswitch-switch: |
| 10 | file.managed: |
| 11 | - source: salt://linux/files/openvswitch-switch.default |
| 12 | - template: jinja |
| 13 | - require: |
| 14 | - pkg: openvswitch_pkgs |
| 15 | |
| 16 | openvswitch_switch_service: |
| 17 | service.running: |
| 18 | - name: openvswitch-switch |
| 19 | - enable: true |
| 20 | {%- if grains.get('noservices') %} |
| 21 | - onlyif: /bin/false |
| 22 | {%- endif %} |
| 23 | - watch: |
| 24 | - file: /etc/default/openvswitch-switch |
| 25 | |
| 26 | {%- endif %} |