浏览代码

Merge pull request #171 from tommycz1/ovs_set_hostname

Match server hostname in Open_vSwitch table
pull/176/head
Aleš Komárek 6 年前
父节点
当前提交
82016b72b6
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 29 次插入0 次删除
  1. +18
    -0
      linux/files/openvswitch-switch.systemd
  2. +11
    -0
      linux/network/openvswitch.sls

+ 18
- 0
linux/files/openvswitch-switch.systemd 查看文件

@@ -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


+ 11
- 0
linux/network/openvswitch.sls 查看文件

@@ -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

正在加载...
取消
保存