mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-12-28 11:20:18 +01:00
e83cb52ded
The option was introduced in6bb0d7b456
without documentation and intended use. The recent changef6ae2094fe
propagated this option to the generated service files, which is resulting in unexpected results, when a user decided to set only `sshd_config_file` for the second sshd service causing the service file points to the system-wide configuration file. This is an attempt to fix this by introducing some heuristics to guess if the user wants to set up second drop-in directory (ending with .d) or create a standalone configuration file. Fixes: #280
34 lines
1.1 KiB
Django/Jinja
34 lines
1.1 KiB
Django/Jinja
[Unit]
|
|
Description=OpenBSD Secure Shell server per-connection daemon
|
|
Documentation=man:sshd(8) man:sshd_config(5)
|
|
{% if __sshd_service_after is not none %}
|
|
After={{ __sshd_service_after }}
|
|
{% endif %}
|
|
{% if __sshd_service_wants is string %}
|
|
Wants={{ __sshd_service_wants }}
|
|
{% elif __sshd_service_wants is iterable %}
|
|
{% for file in __sshd_service_wants %}
|
|
Wants={{ file }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
[Service]
|
|
{% if __sshd_environment_file is string %}
|
|
EnvironmentFile=-{{ __sshd_environment_file }}
|
|
{% elif __sshd_environment_file is iterable %}
|
|
{% for file in __sshd_environment_file %}
|
|
EnvironmentFile=-{{ file }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
ExecStart=-{{ sshd_binary }} -i {{ __sshd_environment_variable }} -f
|
|
{%- if sshd_main_config_file is not none and sshd_config_file | dirname == sshd_main_config_file ~ '.d' %}
|
|
{{- sshd_main_config_file }}
|
|
{% else %}
|
|
{{- sshd_config_file }}
|
|
{% endif %}
|
|
StandardInput=socket
|
|
{% if __sshd_runtime_directory is not none %}
|
|
RuntimeDirectory={{ __sshd_runtime_directory }}
|
|
RuntimeDirectoryPreserve=yes
|
|
RuntimeDirectoryMode={{ __sshd_runtime_directory_mode }}
|
|
{% endif %}
|