{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' runuser -u node_exporter -- ' if vrf is vyos_defined else '' %} [Unit] Description=Node Exporter Documentation=https://github.com/prometheus/node_exporter After=network.target [Service] {% if vrf is not vyos_defined %} User=node_exporter {% endif %} ExecStart={{ vrf_command }}/usr/sbin/node_exporter \ {% if listen_address is vyos_defined %} {% for address in listen_address %} --web.listen-address={{ address }}:{{ port }} {% endfor %} {% else %} --web.listen-address=:{{ port }} {% endif %} [Install] WantedBy=multi-user.target