File tree Expand file tree Collapse file tree 2 files changed +10
-18
lines changed
ssh_hardening_custom_tests Expand file tree Collapse file tree 2 files changed +10
-18
lines changed Original file line number Diff line number Diff line change 75
75
update_cache : true
76
76
when : ansible_facts.os_family == 'Archlinux'
77
77
78
- - name : Create ssh host keys # noqa ignore-errors
79
- ansible.builtin.command : ssh-keygen -A
80
- when : not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat'])
81
- and (ansible_facts.distribution_major_version < '7'
82
- or ansible_facts.distribution_major_version > '9' ))
83
- or ansible_facts.distribution == "Fedora"
84
- or ansible_facts.distribution == "Amazon"
85
- or ansible_facts.os_family == "Suse"
86
- changed_when : false
78
+ - name : Create ssh host keys via Systemd service start # noqa ignore-errors
79
+ ansible.builtin.service :
80
+ name : " sshd"
81
+ state : started
82
+ when : ansible_facts.service_mgr == 'systemd'
87
83
ignore_errors : true
Original file line number Diff line number Diff line change 75
75
update_cache : true
76
76
when : ansible_facts.os_family == 'Alpine'
77
77
78
- - name : Create ssh host keys # noqa ignore-errors
79
- ansible.builtin.command : ssh-keygen -A
80
- when : not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat'])
81
- and (ansible_facts.distribution_major_version < '7'
82
- or ansible_facts.distribution_major_version > '9' ))
83
- or ansible_facts.distribution == "Fedora"
84
- or ansible_facts.distribution == "Amazon"
85
- or ansible_facts.os_family == "Suse"
86
- changed_when : false
78
+ - name : Create ssh host keys via Systemd service start # noqa ignore-errors
79
+ ansible.builtin.service :
80
+ name : " sshd"
81
+ state : started
82
+ when : ansible_facts.service_mgr == 'systemd'
87
83
ignore_errors : true
You can’t perform that action at this time.
0 commit comments