Skip to content

Commit 837d235

Browse files
Merge pull request #1050 from rabi/OSPRH-20269_1
Use become:true when reloading service
2 parents 57a2228 + b34b7d6 commit 837d235

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

roles/edpm_sshd/tasks/configure.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@
7070

7171
- name: Update sshd configuration options from vars
7272
ansible.builtin.set_fact:
73-
_edpm_sshd_server_options: |-
74-
{% set _ = edpm_sshd_server_options.__setitem__('PasswordAuthentication', edpm_sshd_password_authentication) %}
75-
{% if edpm_sshd_banner_enabled %}
76-
{% set _ = edpm_sshd_server_options.__setitem__('Banner', '/etc/issue') %}
77-
{% endif %}
78-
{{ edpm_sshd_server_options }}
73+
_edpm_sshd_server_options: >-
74+
{{ edpm_sshd_server_options |
75+
combine({'PasswordAuthentication': edpm_sshd_password_authentication}) |
76+
combine({'Banner': '/etc/issue'} if edpm_sshd_banner_enabled else {}) }}
7977
8078
- name: Adjust ssh server configuration
8179
become: true
@@ -87,6 +85,7 @@
8785
register: sshd_config_result
8886

8987
- name: Reload sshd due to config change
88+
become: true
9089
ansible.builtin.systemd:
9190
name: sshd
9291
state: reloaded

0 commit comments

Comments
 (0)