mirror of
https://github.com/matter-labs/ansible-en-role.git
synced 2025-12-06 10:59:56 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 41f491a0bd |
@ -65,16 +65,3 @@
|
||||
ip_version: ipv6
|
||||
state: saved
|
||||
path: /etc/iptables/rules.v6
|
||||
|
||||
- name: Disable SSH password authentication
|
||||
when: disable_ssh_password_auth
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: '^#PasswordAuthentication yes'
|
||||
line: 'PasswordAuthentication no'
|
||||
|
||||
- name: Restart ssh
|
||||
when: disable_ssh_password_auth
|
||||
ansible.builtin.service:
|
||||
name: ssh
|
||||
state: restarted
|
||||
|
||||
@ -3,5 +3,9 @@
|
||||
ansible.builtin.include_tasks: firewall.yml
|
||||
when: use_predefined_iptables
|
||||
|
||||
- name: Disable SSH password auth
|
||||
ansible.builtin.include_tasks: ssh-config.yml
|
||||
when: disable_ssh_password_auth
|
||||
|
||||
- name: Prepare configs
|
||||
ansible.builtin.include_tasks: provision.yml
|
||||
|
||||
11
tasks/ssh-config.yml
Normal file
11
tasks/ssh-config.yml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: Disable SSH password authentication
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: '^#PasswordAuthentication yes'
|
||||
line: 'PasswordAuthentication no'
|
||||
|
||||
- name: Restart ssh
|
||||
ansible.builtin.service:
|
||||
name: ssh
|
||||
state: restarted
|
||||
Reference in New Issue
Block a user