summaryrefslogtreecommitdiff
path: root/data/templates/sflow/override.conf.j2
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-22 08:12:21 +0100
committerChristian Breunig <christian@breunig.cc>2024-01-22 08:12:21 +0100
commit64473fa6f320375fb3d3de4de9e729f456ee5ae2 (patch)
tree515fce4e97b9103f320bc8d55a9a7b2fd0f13f89 /data/templates/sflow/override.conf.j2
parentc9bceff2191986af504b114d2d8cfc3547f72ed1 (diff)
downloadvyos-1x-64473fa6f320375fb3d3de4de9e729f456ee5ae2.tar.gz
vyos-1x-64473fa6f320375fb3d3de4de9e729f456ee5ae2.zip
sflow: T5968: add VRF support
Add support to run hsflowd in a dedicated (e.g. management) VRF. Command will be "set system sflow vrf <name>" like with any other service
Diffstat (limited to 'data/templates/sflow/override.conf.j2')
-rw-r--r--data/templates/sflow/override.conf.j23
1 files changed, 2 insertions, 1 deletions
diff --git a/data/templates/sflow/override.conf.j2 b/data/templates/sflow/override.conf.j2
index f2a982528..73588fdb2 100644
--- a/data/templates/sflow/override.conf.j2
+++ b/data/templates/sflow/override.conf.j2
@@ -1,3 +1,4 @@
+{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %}
[Unit]
After=
After=vyos-router.service
@@ -7,7 +8,7 @@ ConditionPathExists=/run/sflow/hsflowd.conf
[Service]
EnvironmentFile=
ExecStart=
-ExecStart=/usr/sbin/hsflowd -m %m -d -f /run/sflow/hsflowd.conf
+ExecStart={{ vrf_command }}/usr/sbin/hsflowd -m %m -d -f /run/sflow/hsflowd.conf
WorkingDirectory=
WorkingDirectory=/run/sflow
PIDFile=