base-system/roles/ssh/tasks/main.yml

23 lines
448 B
YAML
Raw Permalink Normal View History

2022-04-11 15:20:12 +03:00
---
- 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"