Files
ansible_uni_deploy/roles/service_start/tasks/ssh_server.yml
2023-04-19 17:02:43 +02:00

19 lines
344 B
YAML

---
- name: replace line
become: true
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^(.*)#PasswordAuthentication yes(.*)$'
line: 'PasswordAuthentication no'
backrefs: yes
- name: Start and enable sshd
become: true
ansible.builtin.service:
name: sshd
state: started
enabled: true
when: host != 'ntb'