25 lines
445 B
YAML
25 lines
445 B
YAML
- name: Install OpenSSH
|
|
apt:
|
|
name: openssh-server
|
|
become: true
|
|
|
|
- name: Define context
|
|
set_fact:
|
|
user: jake
|
|
enable_root: false
|
|
|
|
- name: SSH config
|
|
template:
|
|
src: files/sshd_config
|
|
dest: /etc/ssh/sshd_config
|
|
validate: /usr/sbin/sshd -t -f %s
|
|
backup: yes
|
|
become: true
|
|
register: sshd_config
|
|
|
|
- name: Restart SSH config
|
|
service:
|
|
name: sshd
|
|
state: reloaded
|
|
when: sshd_config.changed
|
|
become: true
|