2020-11-23 21:39:50 +01:00
|
|
|
---
|
|
|
|
- name: Make sure openssh is installed before creating backup
|
|
|
|
package:
|
|
|
|
name: openssh-server
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Make sure openssh has runtime directory on debian
|
|
|
|
file:
|
|
|
|
path: /run/sshd
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0755"
|
|
|
|
when:
|
|
|
|
- ansible_facts['os_family'] == 'Debian'
|
2021-08-03 10:09:13 +02:00
|
|
|
|
|
|
|
- name: Define common variables
|
|
|
|
set_fact:
|
|
|
|
main_sshd_config: /etc/ssh/sshd_config
|
|
|
|
main_sshd_config_name: sshd_config
|
|
|
|
main_sshd_config_path: /etc/ssh/
|
|
|
|
|
|
|
|
- name: Define specific variables
|
|
|
|
set_fact:
|
|
|
|
main_sshd_config: /etc/ssh/sshd_config.d/00-ansible_system_role.conf
|
|
|
|
main_sshd_config_name: 00-ansible_system_role.conf
|
|
|
|
main_sshd_config_path: /etc/ssh/sshd_config.d/
|
2022-04-12 11:40:35 +02:00
|
|
|
when:
|
2022-05-02 18:38:50 +02:00
|
|
|
- (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version']|int > 8) or
|
|
|
|
(ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_major_version']|int >= 22)
|