Adapt my old role to OpenBSD
This commit is contained in:
		@@ -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
									
								
							
							
						
						
									
										6
									
								
								handlers/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
- name: sshd | Apply config
 | 
			
		||||
  service:
 | 
			
		||||
    name: sshd
 | 
			
		||||
    state: restarted
 | 
			
		||||
							
								
								
									
										20
									
								
								tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								tasks/main.yml
									
									
									
									
									
										Normal 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
 | 
			
		||||
		Reference in New Issue
	
	Block a user