2023-05-15 16:22:48 +00:00
|
|
|
---
|
|
|
|
# task/configure_host file for provision_management_user
|
|
|
|
- name: "Lock root password authentication"
|
|
|
|
ansible.builtin.lineinfile:
|
2023-06-18 20:07:03 +00:00
|
|
|
dest: /etc/ssh/sshd_config
|
|
|
|
regexp: '^PasswordAuthentication'
|
|
|
|
line: "PasswordAuthentication no"
|
|
|
|
state: present
|
|
|
|
backup: yes
|
2023-05-15 16:22:48 +00:00
|
|
|
notify:
|
|
|
|
- systemctl-restart-sshd
|
|
|
|
when: provision_management_user_disable_root_password_auth
|
|
|
|
|
|
|
|
- name: "Lock root authentication"
|
|
|
|
ansible.builtin.lineinfile:
|
2023-06-18 20:07:03 +00:00
|
|
|
dest: /etc/ssh/sshd_config
|
|
|
|
regexp: '^PermitRootLogin'
|
|
|
|
line: "PermitRootLogin no"
|
|
|
|
state: present
|
|
|
|
backup: yes
|
2023-05-15 16:22:48 +00:00
|
|
|
notify:
|
|
|
|
- systemctl-restart-sshd
|
|
|
|
when: provision_management_user_disable_root_login
|