This commit is contained in:
2022-04-11 12:20:12 +00:00
commit 5ac9ed8242
18 changed files with 846 additions and 0 deletions

22
roles/ssh/tasks/main.yml Normal file
View File

@@ -0,0 +1,22 @@
---
- name: Put authorized keys
template:
src: files/auth_keys
dest: /etc/ssh/auth_keys
- name: Put sshd config
template:
src: files/sshd_config
dest: /etc/ssh/sshd_config
notify: Reload sshd
- name: Set different SSH port
lineinfile:
dest: /etc/ssh/sshd_config
state: present
regexp: '^Port'
line: 'Port 6666'
validate: 'sshd -t -f %s'
notify: Reload sshd
when: "'publicservices' in group_names"