17 lines
		
	
	
	
		
			576 B
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			576 B
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
| #!/usr/bin/env bash
 | |
| 
 | |
| # Ideally we would use --invocation instead of --since, but this isn't supported in the systemd version Debian 12 ships.
 | |
| ANSIBLE_PULL_LOG=$(journalctl --unit=ansible-pull --identifier=ansible-pull --since=-6h --output=cat)
 | |
| 
 | |
| MESSAGE="Subject: [{{ inventory_hostname }}] ansible-pull: execution failure
 | |
| 
 | |
| An error occured during the ansible-pull execution.
 | |
| 
 | |
| Logs:
 | |
| ""$ANSIBLE_PULL_LOG""
 | |
| 
 | |
| To view the logs yourself run:
 | |
| journalctl --unit=ansible-pull --identifier=ansible-pull -e
 | |
| "
 | |
| 
 | |
| printf "$MESSAGE" | msmtp '{{ ansible_pull__failure_notification_address }}'
 |