moved sshbanner to general, added to rhel environments

This commit is contained in:
Bryan Joshua Pedini 2022-12-03 15:16:11 +01:00
parent e08d153757
commit 8c21e1d365
4 changed files with 16 additions and 1 deletions

View File

@ -2,5 +2,8 @@
- hosts: all
become: true
tasks:
- import_tasks: tasks/debian-general/sshbanner-bjphoster.yml
- import_tasks: tasks/general/sshbanner-bjphoster.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"

View File

@ -0,0 +1,5 @@
---
- name: Restart SSH service to apply new rules
ansible.builtin.systemd:
name: sshd
state: restarted

View 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