ansible/roles/spiped/templates/spiped.service.j2

23 lines
655 B
Plaintext
Raw Normal View History

2020-01-23 14:00:57 +00:00
{% set keyfile = "{0}/{1}.key".format(spiped_etc_path, item.name) %}
# {{ ansible_managed }}
[Unit]
Description=spiped tunnel {{ item.name }}
Wants=network-online.target
After=network-online.target
[Service]
User={{ spiped_user }}
{% if item.type == 'client' %}
ExecStart=/usr/bin/spiped -F -g -k {{ keyfile }} -D -e -s '{{ item.source_socket }}' -t '{{ item.target_socket }}'
{% else %}
ExecStart=/usr/bin/spiped -F -g -k {{ keyfile }} -d -s '{{ item.source_socket }}' -t '{{ item.target_socket }}'
{% endif %}
Restart=always
RestartSec=60
RuntimeDirectory=spiped
PIDFile={{ spiped_run_path }}/{{ item.name }}.pid
[Install]
WantedBy=multi-user.target