diff --git a/tasks/ssh_config.yml b/tasks/ssh_config.yml index bb5e4ac..a71e756 100644 --- a/tasks/ssh_config.yml +++ b/tasks/ssh_config.yml @@ -22,6 +22,19 @@ validate: /usr/sbin/sshd -t -f %s backup: true notify: restart_sshd + when: + - ansible_distribution_major_version == '8' + + - name: Ensure an empty file exists + ansible.builtin.template: + state: touch + path: "/etc/ssh/sshd_config.d/99-end.conf" + owner: root + group: root + mode: '0600' + notify: restart_sshd + when: + - ansible_distribution_major_version == '8' - name: Ensure sshd_config.d dir exists ansible.builtin.file: @@ -37,16 +50,16 @@ - (ansible_facts['distribution'] == 'Fedora') or (ansible_facts['distribution'] in el_distro_name and ansible_facts['distribution_major_version']|int >= 9) block: - - name: Modular configuration (redhat) - template: - src: "etc/ssh/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-50-redhat.conf.j2" - dest: "{{ ssh_modular_config }}" - owner: root - group: root - mode: '0600' - validate: /usr/sbin/sshd -t -f %s - backup: yes - notify: restart_sshd + #- name: Modular configuration (redhat) + # template: + # src: "etc/ssh/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-50-redhat.conf.j2" + # dest: "{{ ssh_modular_config }}" + # owner: root + # group: root + # mode: '0600' + # validate: /usr/sbin/sshd -t -f %s + # backup: yes + # notify: restart_sshd - name: Custom Modular Configuration template: