ansible-role-systemd_service/templates/systemd-socket.j2
Jonathan Rosser abbc5c8ab8 Suppress 'Service' directive if ListenStream is specified
This is mutually exclusive configuration

Change-Id: Icf43a8421f4d52570ea89f5db0722c0d99bafd85
2022-01-11 03:25:53 -05:00

26 lines
598 B
Django/Jinja

# {{ ansible_managed }}
[Unit]
Description={{ item.1.socket_name }} socket
{% for target in item.1.after_targets | default([]) %}
After={{ target }}
{% endfor %}
{% for target in item.1.before_targets | default([]) %}
Before={{ target }}
{% endfor %}
{% for target in item.1.bind_targets | default([]) %}
BindsTo={{ target }}
{% endfor %}
[Socket]
{% if 'ListenStream' not in item.1.options %}
Service={{ item.0.service_name | replace(' ', '_') }}.service
{% endif %}
{% for key, var in item.1.options.items() | default({}) %}
{{ key }}={{ var }}
{% endfor %}
[Install]
WantedBy=sockets.target