You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible_heinlein/roles/ssh-keyonly/tasks/main.yml

18 lines
373 B

---
- name: "Set «PermitRootLogin» to «without-password»"
lineinfile:
dest: /etc/ssh/sshd_config
regexp: '^#? *PermitRootLogin'
line: "PermitRootLogin without-password"
backup: yes
register: sshconfigchanged
- name: Restart sshd
service:
name: "{{ ssh_service_name }}"
state: restarted
sleep: 5
when: sshconfigchanged is changed