--- - name: Run Docker Compose Pull and Up for Multiple Directories hosts: "{{ target_hosts }}" # Dynamically populated by Semaphore UI become: true tasks: - name: Install Python Docker SDK (Debian/Ubuntu) ansible.builtin.apt: name: python3-docker state: present update_cache: yes cache_valid_time: 3600 - name: Verify Docker is active ansible.builtin.service: name: docker state: started enabled: yes - name: Pull and Start Docker Compose Stacks community.docker.docker_compose_v2: project_src: "{{ item }}" state: present pull: always loop: "{{ compose_dirs }}"