ansible-role-systemd_service/templates/systemd-socket.j2
Dmitriy Rabotyagov 763eb7638f Add possibility to configure systemd sockets
We need to be able to configure systemd-sockets. Since they are attached
to the service it make sense to make it as an element to the service.

Change-Id: Ic481921151fc8d7af7f1ca9b003adb8e3c967e16
2021-01-06 10:53:07 +00:00

23 lines
539 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]
Service={{ item.0.service_name | replace(' ', '_') }}.service
{% for key, var in item.1.options.items() | default({}) %}
{{ key }}={{ var }}
{% endfor %}
[Install]
WantedBy=sockets.target