aboutsummaryrefslogblamecommitdiffstats
path: root/roles/space_server/tasks/sshd.yml
blob: aaf645264c029c81592c049016ecbb64eaeaaf8e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11



                            
                  
       
            



                                

                               
             



                                     
         
                






                           

                          


                                                                       
              

                        
---
- name: Install sshd package
  dnf:
    name: openssh-server
    state: present
  tags:
  - packages

- name: Configure sshd
  lineinfile:
    path: '/etc/ssh/sshd_config'
    regexp: '{{ item.regexp }}'
    line: '{{ item.line }}'
  with_items:
  - regexp: '^PasswordAuthentication'
    line: 'PasswordAuthentication no'
  - regexp: '^#*GSSAPIAuthentication'
    line: 'GSSAPIAuthentication no'
  notify:
  - restart sshd

- name: Enable sshd service
  systemd:
    name: sshd.service
    enabled: yes
    masked: no
    state: started
  when: not chroot
- name: '- when in chroot'
  command: systemctl enable sshd.service
  args:
    creates: '/etc/systemd/system/multi-user.target.wants/sshd.service'
  when: chroot

# vim: set ts=2 sw=2 et: