only track modular configs for 9

This commit is contained in:
Louis Abel 2022-07-08 15:02:50 -07:00
parent 3caef872e8
commit 13c1a9a8c2
Signed by: label
GPG Key ID: 6735C0E1BD65D048
1 changed files with 23 additions and 10 deletions

View File

@ -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: