mirror of
				https://gitlab.sectorq.eu/jaydee/ansible.git
				synced 2025-10-30 18:01:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			574 B
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			574 B
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
| - hosts: rpi5.home.lan
 | |
|   name: Sync rpi5
 | |
|   become: true
 | |
|   tasks:
 | |
|     - name: Get running packages
 | |
|       ansible.builtin.shell: "docker ps|awk '{print $NF}'"
 | |
|       register: containers
 | |
|     - debug:
 | |
|         msg: "{{ containers.stdout_lines }}"
 | |
|     - name: Stop containers
 | |
|       ansible.builtin.shell: "docker stop {{ item }}"
 | |
|       register: containers
 | |
|       when: item != "NAMES" and item != "watchtower-watchtower-1"
 | |
|       with_items: "{{ containers.stdout_lines }}"
 | |
|     - name: Sync data
 | |
|       ansible.builtin.shell: "/myapps/venv/bin/python3 /myapps/omv_backup.py -r all"
 |