2022-05-02 14:39:00 +02:00
|
|
|
---
|
|
|
|
- name: Update configuration file snippet
|
|
|
|
vars:
|
|
|
|
sshd_skip_defaults: true
|
2022-06-03 12:22:17 +02:00
|
|
|
ansible.builtin.blockinfile:
|
2022-05-02 14:39:00 +02:00
|
|
|
path: "{{ sshd_config_file }}"
|
|
|
|
owner: "{{ sshd_config_owner }}"
|
|
|
|
group: "{{ sshd_config_group }}"
|
|
|
|
mode: "{{ sshd_config_mode }}"
|
|
|
|
block: |
|
|
|
|
{{ __sshd_compat_match_all }}
|
|
|
|
{{ lookup('template', 'sshd_config_snippet.j2') }}
|
2023-04-10 22:19:29 +02:00
|
|
|
create: true
|
2022-05-02 14:39:00 +02:00
|
|
|
marker: "# {mark} sshd system role managed block: namespace {{ sshd_config_namespace }}"
|
|
|
|
validate: >-
|
2022-09-26 16:33:28 +02:00
|
|
|
{% if not __sshd_supports_validate %}
|
|
|
|
true %s
|
|
|
|
{% elif sshd_test_hostkey is defined and sshd_test_hostkey.path is defined %}
|
2022-05-02 14:39:00 +02:00
|
|
|
{{ sshd_binary }} -t -f %s -h {{ sshd_test_hostkey.path }}/rsa_key
|
|
|
|
{% else %}
|
|
|
|
{{ sshd_binary }} -t -f %s
|
|
|
|
{% endif %}
|
|
|
|
backup: "{{ sshd_backup }}"
|
|
|
|
notify: reload_sshd
|