--- - name: Install Docker packages community.general.pacman: name: - docker - docker-compose - name: Create docker-compose directory ansible.builtin.file: path: "{{ docker_compose_dir }}" owner: "{{ admin_username }}" group: "{{ admin_username }}" state: directory - name: Generate docker-compose.yml template: src: "docker-compose.yml.j2" dest: "{{ docker_compose_dir }}/docker-compose.yml" - name: Create systemd unit file template: src: "docker-compose.service.j2" dest: "/etc/systemd/system/docker-compose.service" - name: Compose up systemd: name: docker-compose state: started enabled: true