mirror of
				https://github.com/gjkcz/ansible-void.git
				synced 2025-11-04 11:50:26 +01:00 
			
		
		
		
	Create role for SSH
This commit is contained in:
		
							
								
								
									
										14
									
								
								roles/ssh/tasks/main.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								roles/ssh/tasks/main.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
- name: Ensure SSH directory exists
 | 
			
		||||
  file:
 | 
			
		||||
    path: "{{ ssh_dir }}"
 | 
			
		||||
    state: directory
 | 
			
		||||
    owner: "{{ ssh_user }}"
 | 
			
		||||
    group: "{{ ssh_user }}"
 | 
			
		||||
    mode: 0700
 | 
			
		||||
 | 
			
		||||
- name: Import SSH keys
 | 
			
		||||
  authorized_key:
 | 
			
		||||
    user: "{{ ssh_user }}"
 | 
			
		||||
    key: "{{ item }}"
 | 
			
		||||
    state: present
 | 
			
		||||
  loop: "{{ ssh_keys }}"
 | 
			
		||||
		Reference in New Issue
	
	Block a user