47 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
| ---
 | |
| - name: PVE Cluster Ping Pong Test
 | |
|   hosts: pve_cluster
 | |
|   gather_facts: yes
 | |
|   tasks:
 | |
|     - name: Ping test
 | |
|       ping:
 | |
|       register: ping_result
 | |
| 
 | |
|     - name: Display ping result
 | |
|       debug:
 | |
|         msg: "{{ inventory_hostname }} is reachable!"
 | |
|       when: ping_result is succeeded
 | |
| 
 | |
|     - name: Get hostname
 | |
|       command: hostname
 | |
|       register: hostname_result
 | |
| 
 | |
|     - name: Display hostname
 | |
|       debug:
 | |
|         msg: "Hostname: {{ hostname_result.stdout }}"
 | |
| 
 | |
|     - name: Check Tailscale status
 | |
|       command: tailscale status
 | |
|       register: tailscale_status
 | |
|       ignore_errors: yes
 | |
| 
 | |
|     - name: Display Tailscale status
 | |
|       debug:
 | |
|         msg: "Tailscale status: {{ tailscale_status.stdout_lines }}"
 | |
|       when: tailscale_status.rc == 0
 | |
| 
 | |
|     - name: Test connectivity between nodes
 | |
|       ping:
 | |
|         data: "{{ inventory_hostname }}"
 | |
|       delegate_to: "{{ item }}"
 | |
|       loop: "{{ groups['pve_cluster'] }}"
 | |
|       when: item != inventory_hostname
 | |
|       register: cross_ping_result
 | |
| 
 | |
|     - name: Display cross-connectivity results
 | |
|       debug:
 | |
|         msg: "{{ inventory_hostname }} can reach {{ item.item }}"
 | |
|       loop: "{{ cross_ping_result.results }}"
 | |
|       when: 
 | |
|         - cross_ping_result is defined
 | |
|         - item.ping is defined |