mirror of
				https://gitlab.sectorq.eu/jaydee/ansible.git
				synced 2025-10-30 18:01:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			466 B
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			466 B
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
| - hosts: odroid_master
 | |
|   become: true
 | |
|   tasks:
 | |
|     - name: Get token
 | |
|       shell: 'cat /var/lib/rancher/k3s/server/node-token'
 | |
|       register: K3S_TOKEN
 | |
|     - debug: var=K3S_TOKEN.stdout
 | |
|     - name: "Add K8S Token and Hash to dummy host"
 | |
|       add_host:
 | |
|         name:   "K3S_TOKEN_HOLDER"
 | |
|         token:  "{{ K3S_TOKEN.stdout }}"
 | |
|     - name: "print token"
 | |
|       debug:
 | |
|         msg: "[Master] K3S_TOKEN_HOLDER K8S token is {{ hostvars['K3S_TOKEN_HOLDER']['token'] }}" | 
