Skip to content

Commit

Permalink
rhel: Support ovn-ctl args through env vars.
Browse files Browse the repository at this point in the history
Update the systemd units for ovn-controller and ovn-northd to support
passing additional arguments to the ovn-ctl scripts through environment
variables.  Also add some documentation to the top of these files that
describes how to specify these environment variables in systemd
configuration files.

Add similar documentation to the top of the ovn-controller-vtep system
unit to describe how to specify environment variables for options
passed to ovn-controller-vtep.

Signed-off-by: Russell Bryant <[email protected]>
Co-authored-by: Babu Shanmugam <[email protected]>
Signed-off-by: Babu Shanmugam <[email protected]>
Acked-by: Simon Horman <[email protected]>
  • Loading branch information
russellb and anbu-enovance committed Nov 17, 2016
1 parent 3bc54be commit d3759fa
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
8 changes: 8 additions & 0 deletions rhel/usr_lib_systemd_system_ovn-controller-vtep.service
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# See ovn-controller-vtep(8) for details about ovn-controller-vtep.
#
# You may override the following variables to customize ovn-controller-vtep
# behavior:
Expand All @@ -12,6 +13,13 @@
# ovn-controller-vtep for more details on the format for the db
# location.
#
# To override these variables, you may create a configuration file
# in the /etc/systemd/system/ovn-controller-vtep.d/ directory. For example,
# you could place the following contents in
# /etc/systemd/system/ovn-controller-vtep.d/local.conf:
#
# [System]
# Environment="OVN_DB=unix:/usr/local/var/run/openvswitch/db.sock" "VTEP_DB=unix:/usr/local/var/run/openvswitch/vtep.sock"

[Unit]
Description=OVN VTEP gateway controller daemon
Expand Down
16 changes: 9 additions & 7 deletions rhel/usr_lib_systemd_system_ovn-controller.service
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# See ovn-controller(8) for details about ovn-controller.
#
# You may override the following variables to customize ovn-controller behavior:
#
# OVS_DB - Set this variable to the location of the ovsdb server that is
# serving the Open_vSwitch database for the local ovs-vswitchd.
# See the manpage for ovn-controller for more details on the
# format for the db location.
# To customize the ovn-controller service, you may create a configuration file
# in the /etc/systemd/system/ovn-controller.d/ directory. For example, to specify
# additional options to be passed to the "ovn-ctl start_controller" command, you
# could place the following contents in
# /etc/systemd/system/ovn-controller.d/local.conf:
#
# [System]
# Environment="OVN_CONTROLLER_OPTS=--ovn-controller-log=-vconsole:emer -vsyslog:err -vfile:info"

[Unit]
Description=OVN controller daemon
Expand All @@ -16,5 +18,5 @@ After=openvswitch.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_controller
ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_controller $OVN_CONTROLLER_OPTS
ExecStop=/usr/share/openvswitch/scripts/ovn-ctl stop_controller
13 changes: 12 additions & 1 deletion rhel/usr_lib_systemd_system_ovn-northd.service
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# See ovn-northd(8) for details about ovn-northd.
#
# To customize the ovn-northd service, you may create a configuration file
# in the /etc/systemd/system/ovn-northd.d/ directory. For example, to specify
# additional options to be passed to the "ovn-ctl start_northd" command, you
# could place the following contents in
# /etc/systemd/system/ovn-northd.d/local.conf:
#
# [System]
# Environment="OVN_NORTHD_OPTS=--db-nb-sock=/usr/local/var/run/openvswitch/ovnnb_db.sock --db-sb-sock=/usr/local/var/run/openvswitch/ovnsb_db.sock"

[Unit]
Description=OVN northd management daemon
After=syslog.target
Expand All @@ -8,5 +19,5 @@ After=openvswitch.service
Type=oneshot
RemainAfterExit=yes
Environment=OVS_RUNDIR=%t/openvswitch OVS_DBDIR=/var/lib/openvswitch
ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_northd
ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_northd $OVN_NORTHD_OPTS
ExecStop=/usr/share/openvswitch/scripts/ovn-ctl stop_northd

0 comments on commit d3759fa

Please sign in to comment.