mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-06 17:41:36 +01:00
feat: sshd config
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- monitoring-client
|
- monitoring-client
|
||||||
- monitoring-logs
|
- monitoring-logs
|
||||||
|
- sshd-config
|
||||||
|
|
||||||
- hosts: monitoring
|
- hosts: monitoring
|
||||||
roles:
|
roles:
|
||||||
|
|||||||
4
roles/sshd-config/handlers/main.yml
Normal file
4
roles/sshd-config/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- name: reload sshd
|
||||||
|
systemd:
|
||||||
|
name: sshd
|
||||||
|
state: reloaded
|
||||||
14
roles/sshd-config/tasks/main.yaml
Normal file
14
roles/sshd-config/tasks/main.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
- name: SSH Listen Port 7000
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
line: 'Port 7000'
|
||||||
|
notify:
|
||||||
|
- reload sshd
|
||||||
|
|
||||||
|
- name: SSH Listen Port 22 (safety)
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: '^#Port 22'
|
||||||
|
line: 'Port 22'
|
||||||
|
notify:
|
||||||
|
- reload sshd
|
||||||
Reference in New Issue
Block a user