moved sshbanner to general, added to rhel environments
This commit is contained in:
parent
e08d153757
commit
8c21e1d365
@ -2,5 +2,8 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
- import_tasks: tasks/debian-general/sshbanner-bjphoster.yml
|
- import_tasks: tasks/general/sshbanner-bjphoster.yml
|
||||||
- import_tasks: tasks/debian-general/sshbanner.yml
|
- import_tasks: tasks/debian-general/sshbanner.yml
|
||||||
|
when: ansible_facts["os_family"] == "Debian"
|
||||||
|
- import_tasks: tasks/rhel-general/sshbanner.yml
|
||||||
|
when: ansible_facts["os_family"] == "RedHat"
|
||||||
|
5
tasks/rhel-general/restart-ssh-service.yml
Normal file
5
tasks/rhel-general/restart-ssh-service.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: Restart SSH service to apply new rules
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: sshd
|
||||||
|
state: restarted
|
7
tasks/rhel-general/sshbanner.yml
Normal file
7
tasks/rhel-general/sshbanner.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure SSH banner is uncommented and right path in /etc/ssh/sshd_config
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
line: "Banner /etc/banner"
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: '^#\s*Banner.*$'
|
||||||
|
- import_tasks: restart-ssh-service.yml
|
Loading…
Reference in New Issue
Block a user