sshd_config: for checking use template-engine

This commit is contained in:
Denis Knauf 2024-01-14 22:50:16 +01:00
parent f7c525f38c
commit c6771d666e

View file

@ -5,8 +5,8 @@
command: 'sshd -o "include /dev/null"' command: 'sshd -o "include /dev/null"'
register: sshd_include_option_check register: sshd_include_option_check
failed_when: 'sshd_include_option_check.rc not in [1,255] or sshd_include_option_check.stderr not in ["Include directive not supported as a command-line option", "command-line: line 0: Bad configuration option: include"]' failed_when: 'sshd_include_option_check.rc not in [1,255] or sshd_include_option_check.stderr not in ["Include directive not supported as a command-line option", "command-line: line 0: Bad configuration option: include"]'
- set_facts: - set_fact:
sshd_include_option: 'sshd_include_option_check.stderr == "Include directive not supported as a command-line option"' sshd_include_option: '{{sshd_include_option_check.stderr == "Include directive not supported as a command-line option"}}'
- when: 'true == sshd_include_option' - when: 'true == sshd_include_option'
block: block:
- name: '/etc/ssh/sshd_config.d' - name: '/etc/ssh/sshd_config.d'