Skip to content

Commit

Permalink
EL7 main service file requires mandatory environment file
Browse files Browse the repository at this point in the history
note, that this is not the case for the instantiated, which is in sync
with everything else.

Signed-off-by: Jakub Jelen <[email protected]>
  • Loading branch information
Jakuje committed Feb 15, 2024
1 parent 237e8b4 commit ec0f975
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/sshd.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Documentation=man:sshd(8) man:sshd_config(5)
[Service]
Type=notify
{% if __sshd_environment_file is string %}
EnvironmentFile=-{{ __sshd_environment_file }}
EnvironmentFile={{ __sshd_environment_file_mandatory | ternary('', '-')}}{{ __sshd_environment_file }}
{% elif __sshd_environment_file is iterable %}
{% for file in __sshd_environment_file %}
EnvironmentFile=-{{ file }}
Expand Down
1 change: 1 addition & 0 deletions vars/RedHat_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ __sshd_hostkeys_nofips:
- /etc/ssh/ssh_host_ed25519_key

__sshd_environment_file: /etc/sysconfig/sshd
__sshd_environment_file_mandatory: true
__sshd_environment_variable: $OPTIONS
__sshd_service_after: sshd-keygen.service
__sshd_service_wants: sshd-keygen.service
Expand Down
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ __sshd_supports_validate: true

# The path to an environment file for the SSHD service
__sshd_environment_file: ~
__sshd_environment_file_mandatory: false

# The variable name we are passing from the environment file as an argument to the sshd
__sshd_environment_variable: $OPTIONS
Expand Down

0 comments on commit ec0f975

Please sign in to comment.