Merge branch 'role_netbird_client'
This commit is contained in:
		
						commit
						a79f2cac8a
					
				
							
								
								
									
										6
									
								
								netbird_client/defaults/netbird_client.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								netbird_client/defaults/netbird_client.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					netbird_client:
 | 
				
			||||||
 | 
					  # Key and url to join a network
 | 
				
			||||||
 | 
					  #  leave empty to ignore
 | 
				
			||||||
 | 
					  join_network:
 | 
				
			||||||
 | 
					    setup_key: 
 | 
				
			||||||
 | 
					    management_url: 
 | 
				
			||||||
							
								
								
									
										26
									
								
								netbird_client/tasks/install.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								netbird_client/tasks/install.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					- name: Install Packages
 | 
				
			||||||
 | 
					#  when: docker_file.stat.exists == False
 | 
				
			||||||
 | 
					  package:
 | 
				
			||||||
 | 
					    name:
 | 
				
			||||||
 | 
					      - ca-certificates
 | 
				
			||||||
 | 
					      - curl
 | 
				
			||||||
 | 
					      - gnupg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Add netbird-key
 | 
				
			||||||
 | 
					  apt_key:
 | 
				
			||||||
 | 
					    url: https://pkgs.wiretrustee.com/debian/public.key
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Add netbird-repository
 | 
				
			||||||
 | 
					  apt_repository:
 | 
				
			||||||
 | 
					    repo: "deb https://pkgs.wiretrustee.com/debian stable main"
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					    filename: netbird
 | 
				
			||||||
 | 
					    update_cache: yes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install wireguard & netbird
 | 
				
			||||||
 | 
					  package:
 | 
				
			||||||
 | 
					    name:
 | 
				
			||||||
 | 
					      - wireguard
 | 
				
			||||||
 | 
					      - netbird
 | 
				
			||||||
 | 
					    state: latest
 | 
				
			||||||
							
								
								
									
										16
									
								
								netbird_client/tasks/join-network.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								netbird_client/tasks/join-network.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					- name: Join netbird-network
 | 
				
			||||||
 | 
					  when: "netbird_client.join_network.setup_key is defined"
 | 
				
			||||||
 | 
					  command: "netbird up --management-url {{ netbird_client.join_network.management_url }} --setup-key {{ netbird_client.join_network.setup_key }}"
 | 
				
			||||||
 | 
					  failed_when: command.rc != 0
 | 
				
			||||||
 | 
					  changed_when: "'Connected' in command.stdout"
 | 
				
			||||||
 | 
					  register: command
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Wait for netbird-interface to exist
 | 
				
			||||||
 | 
					  wait_for:
 | 
				
			||||||
 | 
					    path: "/sys/class/net/wt0"
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					  when: command.changed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Gather facts to get changes
 | 
				
			||||||
 | 
					  ansible.builtin.gather_facts:
 | 
				
			||||||
 | 
					  when: command.changed
 | 
				
			||||||
							
								
								
									
										4
									
								
								netbird_client/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								netbird_client/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					- import_tasks: ./install.yml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- import_tasks: ./join-network.yml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user