@@ -0,0 +1,18 @@ | |||
[Unit] | |||
Description=Open vSwitch | |||
Before=network.target | |||
After=network-pre.target ovsdb-server.service ovs-vswitchd.service | |||
PartOf=network.target | |||
Requires=ovsdb-server.service | |||
Requires=ovs-vswitchd.service | |||
[Service] | |||
Type=oneshot | |||
ExecStart=/usr/bin/ovs-vsctl set open . external-ids:hostname=%H | |||
ExecReload=/bin/true | |||
ExecStop=/bin/true | |||
RemainAfterExit=yes | |||
[Install] | |||
WantedBy=multi-user.target | |||
@@ -13,6 +13,17 @@ openvswitch_pkgs: | |||
- require: | |||
- pkg: openvswitch_pkgs | |||
/etc/systemd/system/openvswitch-switch.service: | |||
file.managed: | |||
- source: salt://linux/files/openvswitch-switch.systemd | |||
- template: jinja | |||
- require: | |||
- pkg: openvswitch_pkgs | |||
module.run: | |||
- name: service.systemctl_reload | |||
- onchanges: | |||
- file: /etc/systemd/system/openvswitch-switch.service | |||
openvswitch_switch_service: | |||
service.running: | |||
- name: openvswitch-switch |