Adapt my old role to OpenBSD

master
Oleg Vasilev 2021-12-27 23:30:53 +03:00
parent ac04c70812
commit 78d0ad0abf
3 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,7 @@
# sshd
Ansible role for openssh-server
Ansible role for openssh-server
### Variables
Set `sshd_config_template` to template file you want to deploy as sshd configuration

6
handlers/main.yml Normal file
View File

@ -0,0 +1,6 @@
---
- name: sshd | Apply config
service:
name: sshd
state: restarted

20
tasks/main.yml Normal file
View File

@ -0,0 +1,20 @@
---
- name: sshd | Setup sshd_config
template:
src: "{{ sshd_config_template }}"
dest: /etc/ssh/sshd_config
mode: 0640
owner: root
group: root
validate: sshd -t -f %s
notify: sshd | Apply config
- name: sshd | Enable and start service
service:
name: sshd
state: started
enabled: yes
- name: sshd | Run handlers
meta: flush_handlers