mirror of
				https://gitlab.sectorq.eu/jaydee/ansible.git
				synced 2025-10-30 18:01:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			466 B
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			466 B
		
	
	
	
		
			YAML
		
	
	
		
			Executable File
		
	
	
	
	
| - hosts: rpi5.home.lan
 | |
|   name: Stop 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 }}" |