Use the community.docker.docker_compose_v2 module as it supports proper changed handling out of the box, making the roles code more straightforward and work. Also just do a docker compose restart instead of having the custom docker compose reload script. https://docs.ansible.com/ansible/latest/collections/community/docker/docker_compose_v2_module.html
		
			
				
	
	
		
			11 lines
		
	
	
	
		
			287 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
	
		
			287 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
- name: docker compose down
 | 
						|
  community.docker.docker_compose_v2:
 | 
						|
    project_src: /ansible_docker_compose
 | 
						|
    state: absent
 | 
						|
  become: true
 | 
						|
 | 
						|
- name: docker compose restart
 | 
						|
  community.docker.docker_compose_v2:
 | 
						|
    project_src: /ansible_docker_compose
 | 
						|
    state: restarted
 | 
						|
  become: true
 |