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

View File

@ -22,6 +22,19 @@
validate: /usr/sbin/sshd -t -f %s validate: /usr/sbin/sshd -t -f %s
backup: true backup: true
notify: restart_sshd 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 - name: Ensure sshd_config.d dir exists
ansible.builtin.file: ansible.builtin.file:
@ -37,16 +50,16 @@
- (ansible_facts['distribution'] == 'Fedora') or - (ansible_facts['distribution'] == 'Fedora') or
(ansible_facts['distribution'] in el_distro_name and ansible_facts['distribution_major_version']|int >= 9) (ansible_facts['distribution'] in el_distro_name and ansible_facts['distribution_major_version']|int >= 9)
block: block:
- name: Modular configuration (redhat) #- name: Modular configuration (redhat)
template: # template:
src: "etc/ssh/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-50-redhat.conf.j2" # src: "etc/ssh/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-50-redhat.conf.j2"
dest: "{{ ssh_modular_config }}" # dest: "{{ ssh_modular_config }}"
owner: root # owner: root
group: root # group: root
mode: '0600' # mode: '0600'
validate: /usr/sbin/sshd -t -f %s # validate: /usr/sbin/sshd -t -f %s
backup: yes # backup: yes
notify: restart_sshd # notify: restart_sshd
- name: Custom Modular Configuration - name: Custom Modular Configuration
template: template: