diff --git a/tasks/main.yml b/tasks/main.yml index 5625b3a..2156f6c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -21,7 +21,15 @@ # notify: Restart ssh - name: Installation de la configuration ssh - template: src="{{ item }}" dest=/etc/ssh/sshd_config owner=root group=root mode=0600 + template: + src: "{{ item }}" + dest: /etc/ssh/sshd_config + owner: root + group: root + mode: 0600 + backup: 'yes' + validate: '/usr/sbin/sshd -t -f %s' + with_first_found: - files: - sshd_config-{{ ansible_hostname }}.j2