good start
This commit is contained in:
		
							
								
								
									
										7
									
								
								roles/ssh-key-copy/tasks/copy.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								roles/ssh-key-copy/tasks/copy.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
- name: add ssh keys
 | 
			
		||||
  ansible.posix.authorized_key:
 | 
			
		||||
    user: "{{ ansible_user }}"
 | 
			
		||||
    state: present
 | 
			
		||||
    # copy file present on the controller to the remote host
 | 
			
		||||
    # https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html
 | 
			
		||||
    key: "{{ lookup('file', '~/.ssh/default.pub') }}"
 | 
			
		||||
							
								
								
									
										2
									
								
								roles/ssh-key-copy/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								roles/ssh-key-copy/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
- name: copy
 | 
			
		||||
  include_tasks: copy.yml
 | 
			
		||||
		Reference in New Issue
	
	Block a user