forked from CCCHH/ansible-infra
		
	
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			814 B
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			814 B
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
| [Unit]
 | |
| Description=ansible-pull for configuration and maintenance
 | |
| After=network-online.target
 | |
| Wants=network-online.target
 | |
| 
 | |
| [Service]
 | |
| Type=oneshot
 | |
| Environment="SOPS_AGE_KEY_FILE=/etc/ansible_pull_secrets/age_private_key"
 | |
| ExecStart=/usr/local/lib/ansible_pull_venv/bin/ansible-pull \
 | |
|           --directory /home/chaos/ansible_pull_checkout \
 | |
|           --clean \
 | |
|           --url "{{ ansible_pull__repo_url }}" \
 | |
|           --checkout "{{ ansible_pull__checkout }}" \
 | |
|           --inventory "{{ ansible_pull__inventory }}" \
 | |
|           "{{ ansible_pull__playbook }}"
 | |
| User={{ ansible_pull__user }}
 | |
| # Reboot, if /var/run/reboot-required or /var/run/ansible-reboot-required exist.
 | |
| ExecStartPost=/usr/bin/bash -c 'if [ -e /var/run/reboot-required ] || [ -e /var/run/ansible-reboot-required ]; then sudo systemctl reboot; fi'
 |