Added Raspberry Pi watchdog setup
This commit is contained in:
		
							parent
							
								
									9cf1463a75
								
							
						
					
					
						commit
						ed6116f9c5
					
				
							
								
								
									
										33
									
								
								playbooks/rpi-watchdog.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								playbooks/rpi-watchdog.yaml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,33 @@ | ||||
| --- | ||||
| - name: Configure watchdog on raspberry pis | ||||
|   hosts: raspberries | ||||
|   tasks: | ||||
|     # https://raspberrypi.stackexchange.com/a/99625 | ||||
|     - name: Configure watchdog runtime to 10 sec | ||||
|       ansible.builtin.replace: | ||||
|         regexp: '#?RuntimeWatchdogSec=\d+' | ||||
|         replace: 'RuntimeWatchdogSec=10' | ||||
|         path: /etc/systemd/system.conf | ||||
|       become: true | ||||
|       become_method: sudo | ||||
|       register: runtime_watchdoggo | ||||
|     - name: Configure watchdog shutdown timer to 10 min | ||||
|       ansible.builtin.replace: | ||||
|         regexp: '#?ShutdownWatchdogSec=\d+[a-z]*' | ||||
|         replace: 'ShutdownWatchdogSec=10min' | ||||
|         path: /etc/systemd/system.conf | ||||
|       become: true | ||||
|       become_method: sudo | ||||
|       register: shutdown_watchdoggo | ||||
| 
 | ||||
|     - name: Reload systemd if needed | ||||
|       ansible.builtin.systemd_service: | ||||
|         daemon_reload: true | ||||
|       become: true | ||||
|       become_method: sudo | ||||
|       when: runtime_watchdoggo.changed or shutdown_watchdoggo.changed | ||||
| 
 | ||||
| 
 | ||||
| #RuntimeWatchdogSec=0 | ||||
| #ShutdownWatchdogSec=10min | ||||
| 
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 WhatTheMike
						WhatTheMike