aboutsummaryrefslogtreecommitdiffstats
path: root/roles/sshd/tasks/main.yml
blob: b895958cd87b4ea64fa9adb1750f0a77eec8f676 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---

- name: install openssh
  ansible.builtin.package:
    name: openssh
    state: present
  when: ansible_distribution in ["Archlinux"]

- name: generate sshd configuration
  ansible.builtin.template:
    src: sshd_config.j2
    dest: /etc/ssh/sshd_config
    owner: 0
    group: 0
    mode: "0644"

- name: enable and restart sshd
  ansible.builtin.service:
    name: sshd
    state: restarted
    enabled: true

- name: check ssh connection
  ansible.builtin.wait_for:
    port: "{{ sshd_listen_port }}"
    delay: 1
    state: started
remember that computers suck.