Well, first push
This commit is contained in:
4
roles/service_start/tasks/main.yml
Normal file
4
roles/service_start/tasks/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
# tasks file for service_start
|
||||
- name: SSH server
|
||||
ansible.builtin.include_tasks: ssh_server.yml
|
||||
18
roles/service_start/tasks/ssh_server.yml
Normal file
18
roles/service_start/tasks/ssh_server.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- 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'
|
||||
|
||||
Reference in New Issue
Block a user