aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/sshd/tasks/main.yml
blob: fb8d7cc7d5729bf9dd55f4144d759918b65366cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- name: Configure sshd
  become: true
  ansible.builtin.template:
    src: sshd_config.j2
    dest: /etc/ssh/sshd_config
    owner: root
    group: root
    mode: '644'
    validate: /usr/sbin/sshd -t -f %s
  register: sshd_config

- name: Restart sshd
  become: true
  ansible.builtin.systemd_service:
    name: sshd
    state: restarted
  when: sshd_config.changed