--- - name: Deploy and start Movie-DB Application hosts: localhost connection: local become: yes vars: project_name: movie-db install_dir: "/opt/{{ project_name }}" project_src: "{{ playbook_dir }}" tasks: - name: Create installation directory ansible.builtin.file: path: "{{ install_dir }}" state: directory mode: '0755' - name: Copy docker-compose file ansible.builtin.copy: src: "{{ project_src }}/docker-compose.yml" dest: "{{ install_dir }}/docker-compose.yml" - name: Start application with Docker Compose community.docker.docker_compose: project_src: "{{ install_dir }}" state: present restarted: yes