ansible-playbooks/roles/core/tasks/remote_access.yml

34 lines
629 B
YAML

---
- name: Install SSH server
apt:
name: openssh-server
cache_valid_time: 3600
notify:
- Start OpenSSH server
- name: Install packages for remote access
apt:
name: '{{ item }}'
cache_valid_time: 3600
with_items:
- openssh-client
- mosh
- name: Configure OpenSSH server
copy:
src: sshd_config
dest: /etc/ssh/sshd_config
notify:
- Restart OpenSSH server
- name: Configure OpenSSH
copy:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
with_items:
- src: ssh_config
dest: /etc/ssh/ssh_config
- src: ssh_known_hosts
dest: /etc/ssh/ssh_known_hosts