summaryrefslogtreecommitdiff
path: root/roles/common/tasks/ssh.yml
blob: 36498fbf082274cd769657c4c6b761d13b2d5780 (plain)
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
28
29
30
31
- name: Install openssh
  package:
    name: "{{ openssh_pkg }}"
    state: present

- name: Configure sshd
  copy:
    src: sshd_config
    dest: /etc/ssh/sshd_config.d/10-freya.conf
    owner: root
    group: root
    mode: '0664'

- name: Remove old sshd config
  file:
    path: /etc/shh/sshd_config.d/freya.yml
    state: absent

- name: Configure sshd authorized keys
  template:
    src: authorized_keys.j2
    dest: /etc/ssh/authorized_keys
    owner: root
    group: root
    mode: '0644'

- name: Enable sshd service
  service:
    name: "{{ openssh_service }}"
    enabled: true
    state: started