summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-22 08:12:21 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-01-22 07:32:48 +0000
commitd8a151eafbc7f87bd82f19439e37e8c87ca48d6f (patch)
tree1c8b37f68d5b761dfedd2106d3ed38132856a50c /data/templates
parent39d0464616be1fc12be201223a84937b43c19382 (diff)
downloadvyos-1x-d8a151eafbc7f87bd82f19439e37e8c87ca48d6f.tar.gz
vyos-1x-d8a151eafbc7f87bd82f19439e37e8c87ca48d6f.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 (cherry picked from commit 64473fa6f320375fb3d3de4de9e729f456ee5ae2)
Diffstat (limited to 'data/templates')
-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=